Commit Graph
2531 Commits
Author SHA1 Message Date
Nigel Tao 53da68fe4b Refine parse_number_f64's powers_of_10 table
Refine means changing the base-10 exponents from "-348 ..= +340 stepping
by 8" to "-326 ..= +310 stepping by 1".

Binary size, before:
15992 gen/lib/c/clang-5.0-dynamic/wuffs-base-f64conv.lo
16232 gen/lib/c/clang-5.0-static/wuffs-base-f64conv.o
17384 gen/lib/c/gcc-dynamic/wuffs-base-f64conv.lo
17384 gen/lib/c/gcc-static/wuffs-base-f64conv.o

After:
22232 gen/lib/c/clang-5.0-dynamic/wuffs-base-f64conv.lo
22408 gen/lib/c/clang-5.0-static/wuffs-base-f64conv.o
23816 gen/lib/c/gcc-dynamic/wuffs-base-f64conv.lo
23816 gen/lib/c/gcc-static/wuffs-base-f64conv.o

$ g++ -O3 script/process-json-numbers.c
$ time ./a.out -parse-number-f64 < citylots.json
Before/After:
real	0m1.455s
real	0m1.432s

citylots.json is from github.com/zemirco/sf-city-lots-json
2020-07-05 13:58:49 +10:00
Nigel Tao fc1b33a0ff Remove redundant if in MPB__parse_number_f64 2020-07-03 23:47:51 +10:00
Nigel Tao 19b3ce24a3 Optimize high_prec_dec__round_just_enough
name                                                               old time/op  new time/op  delta
wuffs_strconv_render_number_f64_just_enough_fractions/clang5       56.4µs ± 1%  56.3µs ± 1%     ~     (p=1.000 n=5+5)
wuffs_strconv_render_number_f64_just_enough_small_integers/clang5  4.12µs ± 2%  1.00µs ± 1%  -75.65%  (p=0.008 n=5+5)
wuffs_strconv_render_number_f64_just_enough_fractions/gcc7         54.3µs ± 0%  54.2µs ± 0%     ~     (p=0.151 n=5+5)
wuffs_strconv_render_number_f64_just_enough_small_integers/gcc7    4.16µs ± 0%  1.01µs ± 0%  -75.77%  (p=0.000 n=4+5)
2020-07-03 23:44:37 +10:00
Nigel Tao 58678cb342 Add wuffs_base__render_number_f64 benches 2020-07-03 23:16:53 +10:00
Nigel Tao b9afc26387 Add TOKEN__VBD__STRING__CHAIN_ETC 2020-07-03 13:36:13 +10:00
Nigel Tao 0eee231ce6 Add script/process-json-numbers.c 2020-07-03 12:48:37 +10:00
Nigel Tao a6031b6d2e Add wuffs_base__utf_8__next_from_end 2020-07-02 15:08:54 +10:00
Nigel Tao 991e1b2667 wuffs gen -version=0.3.0-alpha.5 2020-07-01 12:22:17 +10:00
Nigel Tao c94ccef400 Make status and vtable names arrays-of-char
Binary size, before:
176288 gen/lib/c/clang-5.0-dynamic/libwuffs.so
  6216 gen/lib/c/clang-5.0-dynamic/wuffs-base-core.lo
216480 gen/lib/c/clang-5.0-static/libwuffs.a
  6144 gen/lib/c/clang-5.0-static/wuffs-base-core.o
196568 gen/lib/c/gcc-dynamic/libwuffs.so
  6736 gen/lib/c/gcc-dynamic/wuffs-base-core.lo
246432 gen/lib/c/gcc-static/libwuffs.a
  6736 gen/lib/c/gcc-static/wuffs-base-core.o

After:
172192 gen/lib/c/clang-5.0-dynamic/libwuffs.so
  5192 gen/lib/c/clang-5.0-dynamic/wuffs-base-core.lo
214400 gen/lib/c/clang-5.0-static/libwuffs.a
  5192 gen/lib/c/clang-5.0-static/wuffs-base-core.o
192472 gen/lib/c/gcc-dynamic/libwuffs.so
  5656 gen/lib/c/gcc-dynamic/wuffs-base-core.lo
240752 gen/lib/c/gcc-static/libwuffs.a
  5656 gen/lib/c/gcc-static/wuffs-base-core.o
2020-07-01 12:16:14 +10:00
Nigel Tao 89ceb9fabc Add wuffs_base__render_number_f64 2020-07-01 12:03:20 +10:00
Nigel Tao 03f85920be Make render_number_etc conversions explicit 2020-06-22 13:56:57 +10:00
Nigel Tao ec5200cb99 Make status and vtable names const pointers 2020-06-22 13:52:29 +10:00
Nigel Tao 668e92cb81 Spin out base-utf8 sub-module
Before:
8224 gen/lib/c/clang-5.0-dynamic/wuffs-base-core.lo
8200 gen/lib/c/clang-5.0-static/wuffs-base-core.o
8704 gen/lib/c/gcc-dynamic/wuffs-base-core.lo
8920 gen/lib/c/gcc-static/wuffs-base-core.o

After:
6216 gen/lib/c/clang-5.0-dynamic/wuffs-base-core.lo
2736 gen/lib/c/clang-5.0-dynamic/wuffs-base-utf8.lo
6216 gen/lib/c/clang-5.0-static/wuffs-base-core.o
2712 gen/lib/c/clang-5.0-static/wuffs-base-utf8.o
6728 gen/lib/c/gcc-dynamic/wuffs-base-core.lo
3008 gen/lib/c/gcc-dynamic/wuffs-base-utf8.lo
6728 gen/lib/c/gcc-static/wuffs-base-core.o
3224 gen/lib/c/gcc-static/wuffs-base-utf8.o
2020-06-22 13:40:03 +10:00
Nigel Tao 22a09b4133 Spin out base-i64conv sub-module
Before:
12624 gen/lib/c/clang-5.0-dynamic/wuffs-base-core.lo
13032 gen/lib/c/clang-5.0-static/wuffs-base-core.o
12184 gen/lib/c/gcc-dynamic/wuffs-base-core.lo
12408 gen/lib/c/gcc-static/wuffs-base-core.o

After:
 8224 gen/lib/c/clang-5.0-dynamic/wuffs-base-core.lo
 5608 gen/lib/c/clang-5.0-dynamic/wuffs-base-i64conv.lo
 8200 gen/lib/c/clang-5.0-static/wuffs-base-core.o
 6032 gen/lib/c/clang-5.0-static/wuffs-base-i64conv.o
 8704 gen/lib/c/gcc-dynamic/wuffs-base-core.lo
 4952 gen/lib/c/gcc-dynamic/wuffs-base-i64conv.lo
 8920 gen/lib/c/gcc-static/wuffs-base-core.o
 4912 gen/lib/c/gcc-static/wuffs-base-i64conv.o
2020-06-21 22:17:42 +10:00
Nigel Tao f5fbc5d8e7 Rename initialize_flags argument 2020-06-21 22:02:20 +10:00
Nigel Tao d40a386211 Add wuffs_base__render_number_{i,u}64 2020-06-21 21:57:48 +10:00
Nigel Tao 00cc8a50aa wuffs gen -version=0.3.0-alpha.4 2020-06-17 21:27:28 +10:00
Nigel Tao d377dcaea8 Don't use #warning (a GCC notion) with MSVC 2020-06-17 21:24:14 +10:00
Nigel Tao 824b87bb86 Roll back cb198413 re MSVC __cplusplus macro
Commit cb19841358 "Work around MSVC's
__cplusplus regarding C++11" did not fix compiler errors with older MSVC
versions as hoped.
2020-06-17 21:18:36 +10:00
Nigel Tao 025f9c208e Roll back 196920ee unique_ptr constructors
Commit 196920ee91 "Spell out
std::unique_ptr constructor calls" did not fix compiler errors with
older MSVC versions as hoped.
2020-06-17 21:12:07 +10:00
Nigel Tao a7418b76fc wuffs gen -version=0.3.0-alpha.3 2020-06-17 15:57:23 +10:00
Nigel Tao 196920ee91 Spell out std::unique_ptr constructor calls 2020-06-17 15:56:46 +10:00
Nigel Tao c8026c91ff wuffs gen -version=0.3.0-alpha.2 2020-06-17 06:46:00 +10:00
Nigel Tao cb19841358 Work around MSVC's __cplusplus regarding C++11 2020-06-17 06:39:45 +10:00
Nigel Tao 635b502649 Tweak lib/dumbindent's comments 2020-06-16 22:34:36 +10:00
Nigel Tao ab580e7696 Add more comments on wuffsfmt's -l and -w flags 2020-06-16 14:27:13 +10:00
Nigel Tao c9b50c0be7 Add links to dumbindent blog post 2020-06-16 14:25:46 +10:00
Nigel Tao c29853ffef Add links to other convert-to-nia implementations 2020-06-16 14:24:00 +10:00
Nigel Tao 30793928d0 wuffs gen -version=0.3.0-alpha.1 2020-06-11 23:02:02 +10:00
Nigel Tao 533b84b3b1 Simplify WUFFS_VERSION_ETC macros 2020-06-11 23:01:50 +10:00
Nigel Tao 82233fe06c Fix dumbindent comment typo 2020-06-10 22:52:49 +10:00
Nigel Tao f89d2ef4ab Update doc/note/auto-formatting.md comparison link 2020-06-10 22:43:51 +10:00
Nigel Tao f935120aa6 Tweak how dumbindent handles #preproc lines 2020-06-10 22:37:54 +10:00
Nigel Tao b1ea22045a Stop dumbindent adding or removing line breaks 2020-06-10 21:51:25 +10:00
Nigel Tao b82396a3c6 Stop dumbindent dropping blank lines near braces 2020-06-10 21:06:06 +10:00
Nigel Tao 58c0862c50 Stop dumbindent collapsing consecutive blank lines 2020-06-10 12:22:41 +10:00
Nigel Tao ed48514f30 Remove ast.NewExpr statusPkg arg 2020-06-10 12:05:48 +10:00
Nigel Tao 7dc73a856a Remove unused checker.exprConstValue method 2020-06-10 11:43:46 +10:00
Nigel Tao 74d291453d Un-special-case parsing base."etc" 2020-06-10 11:34:56 +10:00
Nigel Tao 4e2d0c1e5f Cgen explicit type cast for (CONSTANT >> x) 2020-06-10 10:32:13 +10:00
Nigel Tao 66b0a12b6c Add json.EXPECT_ETC constants 2020-06-09 23:50:35 +10:00
Nigel Tao 3d31ac03eb Add base.TOKEN__ETC constants 2020-06-09 23:34:42 +10:00
Nigel Tao 8bd30e912c Tweak dumbindent.breakAfterBrace 2020-06-09 22:45:40 +10:00
Nigel Tao 63c12cad17 Have dumbindent catch "namespace foo {". 2020-06-09 22:08:39 +10:00
Nigel Tao 3b1d3d0a39 Remove check.Error.OtherFoo fields 2020-06-09 17:00:24 +10:00
Nigel Tao 6f43ab4b92 Reject duplicate top level names 2020-06-09 16:59:43 +10:00
Nigel Tao 1dae694e00 Update doc/note/auto-formatting.md comparison link 2020-06-09 15:59:46 +10:00
Nigel Tao 8bf4084c8b Update dumbindent comparison for clang-format-9
The numbers are the median real time of 5 runs.
2020-06-09 15:46:56 +10:00
Nigel Tao 7e32336de0 Add base.PIXEL_FORMAT__ETC constants 2020-06-09 12:34:34 +10:00
Nigel Tao 983c5cd90e Update doc/note/auto-formatting.md comparison link 2020-06-08 23:29:52 +10:00