summaryrefslogtreecommitdiff
path: root/libc/stdio/stdio.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-12-19 16:30:55 -0800
committerElliott Hughes <enh@google.com>2017-12-19 16:37:01 -0800
commit1133fecde3899183b5c0edee9c92736ad878a290 (patch)
tree00c55fa5d1a6971e5cbf47d4c6d84112c5c9165c /libc/stdio/stdio.cpp
parent9dc37b9439063df2b0db6d1b3a37b491bc3cd427 (diff)
Use inline ctype functions for ato*/strto* and scanf.
This also let us remove the `unsigned char` casts, since we define our inlines to work for all values. Before: Benchmark Time CPU Iterations ------------------------------------------------------------- BM_inttypes_strtoimax 112 ns 112 ns 6222193 BM_inttypes_strtoumax 104 ns 104 ns 6725010 BM_stdlib_strtol 113 ns 113 ns 6195861 BM_stdlib_strtoll 113 ns 113 ns 6195633 BM_stdlib_strtoul 105 ns 105 ns 6691394 BM_stdlib_strtoull 105 ns 105 ns 6690695 BM_stdio_scanf_d 504 ns 503 ns 1385224 BM_stdio_scanf_maps 1900 ns 1898 ns 369260 BM_stdio_scanf_maps_baseline 1030 ns 1030 ns 678832 BM_stdio_scanf_s 433 ns 432 ns 1619086 After: BM_inttypes_strtoimax 91 ns 91 ns 7718194 BM_inttypes_strtoumax 82 ns 82 ns 8508052 BM_stdlib_strtol 92 ns 92 ns 7674694 BM_stdlib_strtoll 91 ns 91 ns 7639228 BM_stdlib_strtoul 83 ns 82 ns 8500304 BM_stdlib_strtoull 82 ns 82 ns 8504929 BM_stdio_scanf_d 465 ns 465 ns 1507891 BM_stdio_scanf_maps 1836 ns 1836 ns 381082 BM_stdio_scanf_maps_baseline 846 ns 845 ns 830881 BM_stdio_scanf_s 419 ns 419 ns 1671979 Bug: N/A Test: ran tests, benchmarks Change-Id: I44681daf16c4328b060770cf11fc0633157c427f
Diffstat (limited to 'libc/stdio/stdio.cpp')
0 files changed, 0 insertions, 0 deletions