Nigel Tao
226c476994
Remove calls to Go's deprecated "io/ioutil"
2021-08-22 11:17:34 +10:00
Nigel Tao
788479dd64
Run "gofmt -w ." for new "//go:build" lines
2021-08-22 10:53:06 +10:00
Nigel Tao
d3c7d103ca
Update script/*.go module dependencies
2021-08-22 10:49:18 +10:00
Nigel Tao
816475b285
Add "b" (for "binary") to fopen calls
...
Updates #50
2021-07-07 20:28:35 +10:00
Nigel Tao
a51867dc63
Fix "forseen" typo
2021-05-19 21:34:09 +10:00
Lander Brandt
ab5f974b66
Use iterators for converting RGB to BGRA in the Rust PNG benchmark
2021-04-07 14:34:35 -07:00
Nigel Tao
61635213cd
Add "‼" to "WUFFS C HEADER ENDS HERE" comment
2021-03-25 14:11:23 +11:00
Nigel Tao
7a73708a56
Have script/bench-*-png convert to BGRA
...
On a mid-range x86_64 laptop:
Compared to the previous commit:
go_decode_19k_8bpp 39.3MB/s ± 1% 39.4MB/s ± 1% ~ (p=0.548 n=5+5)
go_decode_40k_24bpp 46.5MB/s ± 1% 46.7MB/s ± 1% ~ (p=0.095 n=5+5)
go_decode_77k_8bpp 78.3MB/s ± 0% 78.3MB/s ± 0% ~ (p=0.286 n=4+5)
go_decode_552k_32bpp_verify_checksum 120MB/s ± 1% 118MB/s ± 0% ~ (p=0.056 n=5+5)
go_decode_4002k_24bpp 50.7MB/s ± 0% 50.5MB/s ± 0% -0.58% (p=0.016 n=5+4)
rust_decode_19k_8bpp 88.3MB/s ± 0% 89.8MB/s ± 0% +1.76% (p=0.008 n=5+5)
rust_decode_40k_24bpp 133MB/s ± 0% 122MB/s ± 0% -8.58% (p=0.008 n=5+5)
rust_decode_77k_8bpp 180MB/s ± 0% 158MB/s ± 0% -12.04% (p=0.008 n=5+5)
rust_decode_552k_32bpp_verify_checksum 146MB/s ± 0% 136MB/s ± 0% -6.59% (p=0.016 n=4+5)
rust_decode_4002k_24bpp 134MB/s ± 0% 122MB/s ± 0% -9.02% (p=0.008 n=5+5)
Compared to libpng (the C library):
libpng_decode_19k_8bpp 58.0MB/s ± 0% 1.00x
libpng_decode_40k_24bpp 73.1MB/s ± 0% 1.00x
libpng_decode_77k_8bpp 177MB/s ± 0% 1.00x
libpng_decode_552k_32bpp_verify_checksum 146MB/s ± 0% 1.00x
libpng_decode_4002k_24bpp 104MB/s ± 0% 1.00x
go_decode_19k_8bpp/go1.16 39.4MB/s ± 1% 0.68x
go_decode_40k_24bpp/go1.16 46.7MB/s ± 1% 0.64x
go_decode_77k_8bpp/go1.16 78.3MB/s ± 0% 0.44x
go_decode_552k_32bpp_verify_checksum/go1.16 118MB/s ± 0% 0.81x
go_decode_4002k_24bpp/go1.16 50.5MB/s ± 0% 0.49x
rust_decode_19k_8bpp/rust1.48 89.8MB/s ± 0% 1.55x
rust_decode_40k_24bpp/rust1.48 122MB/s ± 0% 1.67x
rust_decode_77k_8bpp/rust1.48 158MB/s ± 0% 0.89x
rust_decode_552k_32bpp_verify_checksum/rust1.48 136MB/s ± 0% 0.93x
rust_decode_4002k_24bpp/rust1.48 122MB/s ± 0% 1.17x
2021-03-25 12:38:02 +11:00
Nigel Tao
5dd7ede975
Add more png benchmarks for alternative mimic libs
...
On a mid-range x86_64 laptop:
"libpng" (Debian's /usr/lib/x86_64-linux-gnu/libpng16.so) numbers are
used as a 1.00x baseline for the other libraries.
(†): libpng's "simplified API" doesn't provide a way to ignore the
checksum. We copy the "verify_checksum" numbers for a 1.00x baseline.
Some of the other libraries don't have the option to ignore or verify
the checksum, always doing only one or the other.
----
libpng_decode_19k_8bpp 58.0MB/s ± 0% 1.00x
libpng_decode_40k_24bpp 73.1MB/s ± 0% 1.00x
libpng_decode_77k_8bpp 177MB/s ± 0% 1.00x
libpng_decode_552k_32bpp_ignore_checksum 146MB/s ± 0% (†)
libpng_decode_552k_32bpp_verify_checksum 146MB/s ± 0% 1.00x
libpng_decode_4002k_24bpp 104MB/s ± 0% 1.00x
----
wuffs_decode_19k_8bpp/clang9 131MB/s ± 0% 2.26x
wuffs_decode_40k_24bpp/clang9 153MB/s ± 0% 2.09x
wuffs_decode_77k_8bpp/clang9 472MB/s ± 0% 2.67x
wuffs_decode_552k_32bpp_ignore_checksum/clang9 370MB/s ± 0% 2.53x
wuffs_decode_552k_32bpp_verify_checksum/clang9 357MB/s ± 0% 2.45x
wuffs_decode_4002k_24bpp/clang9 156MB/s ± 0% 1.50x
wuffs_decode_19k_8bpp/gcc10 136MB/s ± 1% 2.34x
wuffs_decode_40k_24bpp/gcc10 162MB/s ± 0% 2.22x
wuffs_decode_77k_8bpp/gcc10 486MB/s ± 0% 2.75x
wuffs_decode_552k_32bpp_ignore_checksum/gcc10 388MB/s ± 0% 2.66x
wuffs_decode_552k_32bpp_verify_checksum/gcc10 373MB/s ± 0% 2.55x
wuffs_decode_4002k_24bpp/gcc10 164MB/s ± 0% 1.58x
----
libspng_decode_19k_8bpp/clang9 59.3MB/s ± 0% 1.02x
libspng_decode_40k_24bpp/clang9 78.4MB/s ± 0% 1.07x
libspng_decode_77k_8bpp/clang9 189MB/s ± 0% 1.07x
libspng_decode_552k_32bpp_ignore_checksum/clang9 236MB/s ± 0% 1.62x
libspng_decode_552k_32bpp_verify_checksum/clang9 203MB/s ± 0% 1.39x
libspng_decode_4002k_24bpp/clang9 110MB/s ± 0% 1.06x
libspng_decode_19k_8bpp/gcc10 59.6MB/s ± 0% 1.03x
libspng_decode_40k_24bpp/gcc10 77.5MB/s ± 0% 1.06x
libspng_decode_77k_8bpp/gcc10 189MB/s ± 0% 1.07x
libspng_decode_552k_32bpp_ignore_checksum/gcc10 223MB/s ± 0% 1.53x
libspng_decode_552k_32bpp_verify_checksum/gcc10 194MB/s ± 0% 1.33x
libspng_decode_4002k_24bpp/gcc10 109MB/s ± 0% 1.05x
----
lodepng_decode_19k_8bpp/clang9 65.1MB/s ± 0% 1.12x
lodepng_decode_40k_24bpp/clang9 72.1MB/s ± 0% 0.99x
lodepng_decode_77k_8bpp/clang9 222MB/s ± 0% 1.25x
lodepng_decode_552k_32bpp_ignore_checksum/clang9 skipped
lodepng_decode_552k_32bpp_verify_checksum/clang9 162MB/s ± 0% 1.11x
lodepng_decode_4002k_24bpp/clang9 70.5MB/s ± 0% 0.68x
lodepng_decode_19k_8bpp/gcc10 61.1MB/s ± 0% 1.05x
lodepng_decode_40k_24bpp/gcc10 62.5MB/s ± 1% 0.85x
lodepng_decode_77k_8bpp/gcc10 176MB/s ± 0% 0.99x
lodepng_decode_552k_32bpp_ignore_checksum/gcc10 skipped
lodepng_decode_552k_32bpp_verify_checksum/gcc10 139MB/s ± 0% 0.95x
lodepng_decode_4002k_24bpp/gcc10 62.3MB/s ± 0% 0.60x
----
stbimage_decode_19k_8bpp/clang9 75.1MB/s ± 1% 1.29x
stbimage_decode_40k_24bpp/clang9 84.6MB/s ± 0% 1.16x
stbimage_decode_77k_8bpp/clang9 234MB/s ± 0% 1.32x
stbimage_decode_552k_32bpp_ignore_checksum/clang9 162MB/s ± 0% 1.11x
stbimage_decode_552k_32bpp_verify_checksum/clang9 skipped
stbimage_decode_4002k_24bpp/clang9 80.7MB/s ± 0% 0.78x
stbimage_decode_19k_8bpp/gcc10 73.3MB/s ± 0% 1.26x
stbimage_decode_40k_24bpp/gcc10 81.8MB/s ± 0% 1.12x
stbimage_decode_77k_8bpp/gcc10 214MB/s ± 0% 1.21x
stbimage_decode_552k_32bpp_ignore_checksum/gcc10 145MB/s ± 0% 0.99x
stbimage_decode_552k_32bpp_verify_checksum/gcc10 skipped
stbimage_decode_4002k_24bpp/gcc10 79.7MB/s ± 0% 0.77x
----
go_decode_19k_8bpp/go1.16 39.3MB/s ± 1% 0.68x
go_decode_40k_24bpp/go1.16 46.5MB/s ± 1% 0.64x
go_decode_77k_8bpp/go1.16 78.3MB/s ± 0% 0.44x
go_decode_552k_32bpp_ignore_checksum/go1.16 skipped
go_decode_552k_32bpp_verify_checksum/go1.16 120MB/s ± 1% 0.82x
go_decode_4002k_24bpp/go1.16 50.7MB/s ± 0% 0.49x
----
rust_decode_19k_8bpp/rust1.48 88.3MB/s ± 0% 1.52x
rust_decode_40k_24bpp/rust1.48 133MB/s ± 0% 1.82x
rust_decode_77k_8bpp/rust1.48 180MB/s ± 0% 1.02x
rust_decode_552k_32bpp_ignore_checksum/rust1.48 skipped
rust_decode_552k_32bpp_verify_checksum/rust1.48 146MB/s ± 0% 1.00x
rust_decode_4002k_24bpp/rust1.48 134MB/s ± 0% 1.29x
2021-03-24 23:36:48 +11:00
Nigel Tao
85bdcd1e1e
Fix script/benchstat-ratio.go when there's no '/'
2021-03-13 22:40:37 +11:00
Nigel Tao
ee62582609
Tweak some mimic bench names for benchstat-ratio
2021-03-13 13:31:41 +11:00
Nigel Tao
9e4c87b6ab
Add script/benchstat-ratio.go
2021-03-13 00:11:50 +11:00
Nigel Tao
79c7ba0ae9
Add script/print-crc32-x86-sse42-magic-numbers.go
2021-03-07 22:18:52 +11:00
Nigel Tao
3c627574a7
Fix and tweak hand-written decode_huffman_fast
2021-02-10 16:02:05 +11:00
Nigel Tao
f89c3d81bd
Build fix for hand-written decode_huffman_fast
2021-01-29 09:08:25 +11:00
Nigel Tao
2f78804e62
Use more inclusive language
2021-01-23 19:50:47 +11:00
Nigel Tao
5477132298
Have std/png verify PLTE chunk checksums
2021-01-21 20:21:33 +11:00
Nigel Tao
a1c22caa15
Rename load and store to peek and poke
2021-01-17 22:44:39 +11:00
Nigel Tao
f473ffa050
Deprecate script/preprocess-wuffs.go
2020-12-18 22:10:16 +11:00
Nigel Tao
6775c05c08
Have etc-parse-number-f64.cc test fast_float
2020-10-24 17:44:06 +11:00
Nigel Tao
93f9550720
Update manual-test-parse-number-f64.cc data repo
2020-10-23 18:46:12 +11:00
Nigel Tao
ba3818cb6b
Add more parse_number_f64 test cases
2020-09-28 12:51:45 +10:00
Nigel Tao
6c2fb9a2fd
Tweak test/data/artif*/gif-transparent-index.gif
2020-09-27 00:09:25 +10:00
Nigel Tao
344123b179
Add test/data/artificial/gif-transparent-index.gif
2020-09-25 23:01:43 +10:00
Nigel Tao
afe7f27ab7
Trim Eisel-Lemire powers-of-10 tables
...
This tracks the upstream github.com/lemire/fast_double_parser
On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:
$ g++ -O3 script/process-json-numbers.c
$ time ./a.out -parse-number-f64 < citylots.json
Before/After:
real 0m1.035s
real 0m1.003s
Binary size, before:
29544 gen/lib/c/clang-9-dynamic/wuffs-base-floatconv.lo
29648 gen/lib/c/clang-9-static/wuffs-base-floatconv.o
31192 gen/lib/c/gcc-dynamic/wuffs-base-floatconv.lo
31160 gen/lib/c/gcc-static/wuffs-base-floatconv.o
After:
27160 gen/lib/c/clang-9-dynamic/wuffs-base-floatconv.lo
27264 gen/lib/c/clang-9-static/wuffs-base-floatconv.o
28760 gen/lib/c/gcc-dynamic/wuffs-base-floatconv.lo
28760 gen/lib/c/gcc-static/wuffs-base-floatconv.o
2020-09-23 16:18:27 +10:00
Nigel Tao
b6d855210c
Use a formula to calculate Eisel-Lemire power-of-2
...
On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:
$ g++ -O3 script/process-json-numbers.c
$ time ./a.out -parse-number-f64 < citylots.json
Before/After:
real 0m0.992s
real 0m1.035s
2020-09-23 15:23:12 +10:00
Nigel Tao
cd4cbc9102
Tweak JSON trailing comment/new-line quirks
2020-09-22 23:03:49 +10:00
Nigel Tao
f2be4dd7cf
Trim private_implementation__powers_of_10 array
...
Binary size, before:
30344 gen/lib/c/clang-9-dynamic/wuffs-base-floatconv.lo
30488 gen/lib/c/clang-9-static/wuffs-base-floatconv.o
31992 gen/lib/c/gcc-dynamic/wuffs-base-floatconv.lo
31992 gen/lib/c/gcc-static/wuffs-base-floatconv.o
After:
29512 gen/lib/c/clang-9-dynamic/wuffs-base-floatconv.lo
29656 gen/lib/c/clang-9-static/wuffs-base-floatconv.o
31160 gen/lib/c/gcc-dynamic/wuffs-base-floatconv.lo
31160 gen/lib/c/gcc-static/wuffs-base-floatconv.o
2020-09-15 22:14:30 +10:00
Nigel Tao
ddac2c50ee
Add more {parse,render}_number_f64 test cases
2020-09-15 21:17:33 +10:00
Nigel Tao
57d47c633c
Fix etc__high_prec_dec__to_f64 shift amount
...
Shifting 0.299 left by 2 doesn't put us in [½ .. 1].
2020-09-08 16:43:31 +10:00
Nigel Tao
1210340e75
Add script/manual-test-parse-number-f64.cc
2020-09-07 23:11:07 +10:00
Nigel Tao
510c230cf4
Rename USE_FAST_DOUBLE_PARSER macro
2020-09-07 22:59:45 +10:00
Nigel Tao
a20a2bbe56
Fix "stand-alone C++" typo
2020-09-07 21:06:58 +10:00
Nigel Tao
6344181b96
Add look-up table for JSON ASCII escapes
...
On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:
$ time gen/bin/example-jsonptr < citylots.json > /dev/null
Before this commit:
real 0m1.799s
After:
real 0m1.765s
Ratio: 1.02x
2020-08-21 14:11:31 +10:00
Nigel Tao
1adbc9547f
Split std/json's QUIRK_ALLOW_BACKSLASH_X in two
2020-08-06 23:28:07 +10:00
Nigel Tao
1e96ef200c
Add test/data/cbor-rfc-7049-examples.*
2020-07-27 22:00:28 +10:00
Nigel Tao
0054a053f5
Add comment link to github.com/cbor/test-vectors
2020-07-24 22:47:39 +10:00
Nigel Tao
271680333e
Have std/cbor parse tags
2020-07-24 15:54:44 +10:00
Nigel Tao
c9d4e34dfc
Split ETC__VBC__INLINE_INTEGER into {,un}signed
2020-07-21 15:31:49 +10:00
Nigel Tao
4e193599ac
Add std/cbor
2020-07-15 14:08:37 +10:00
Nigel Tao
fcb6416c16
Add script/extract-cbor-rfc-7049-examples.go
2020-07-10 22:56:47 +10:00
Nigel Tao
27766aedf9
Let process-json-numbers use fast_double_parser
2020-07-09 10:59:54 +10:00
Nigel Tao
6b7ce30e32
Add wuffs_base__parse_number_xxx options arg
2020-07-07 16:19:46 +10:00
Nigel Tao
86093c8194
Have parse_number_f64 use the Eisel algorithm
...
The algorithm is discussed at
https://lemire.me/blog/2020/03/10/fast-float-parsing-in-practice/
----
Binary size, before:
27848 gen/lib/c/clang-5.0-dynamic/wuffs-base-f64conv.lo
28040 gen/lib/c/clang-5.0-static/wuffs-base-f64conv.o
30392 gen/lib/c/gcc-dynamic/wuffs-base-f64conv.lo
30392 gen/lib/c/gcc-static/wuffs-base-f64conv.o
After:
29416 gen/lib/c/clang-5.0-dynamic/wuffs-base-f64conv.lo
29688 gen/lib/c/clang-5.0-static/wuffs-base-f64conv.o
31792 gen/lib/c/gcc-dynamic/wuffs-base-f64conv.lo
31792 gen/lib/c/gcc-static/wuffs-base-f64conv.o
The binary size difference does not account for the powers-of-10 table,
which was expanded in a previous commit in anticipation of this one. A
future commit will also remove some of the other f64 parser code used
before implementing the Eisel algorithm.
----
Processing citylots.json from github.com/zemirco/sf-city-lots-json
$ g++ -O3 script/process-json-numbers.c
$ time ./a.out -parse-number-f64 < citylots.json
Before/After:
real 0m1.231s
real 0m1.031s
The difference with and without -parse-number-f64 measures how much time
is spent in the parse_number_f64 function. Before: 424ms, after: 224ms.
$ time ./a.out < citylots.json
real 0m0.807s
Similarly, for canada.json from github.com/miloyip/nativejson-benchmark
$ time ./a.out -parse-number-f64 < canada.json
Before/After:
real 0m0.023s
real 0m0.017s
$ time ./a.out < canada.json
real 0m0.013s
Time spent in parse_number_f64, before: 10ms, after: 4ms.
----
name old time/op new time/op delta
wuffs_strconv_parse_number_f64_1_lsh53_add0/clang5 77.0ns ± 0% 37.0ns ± 0% -51.95% (p=0.029 n=4+4)
wuffs_strconv_parse_number_f64_1_lsh53_add1/clang5 690ns ± 0% 725ns ± 2% +4.95% (p=0.008 n=5+5)
wuffs_strconv_parse_number_f64_pi_long/clang5 92.0ns ± 0% 136.0ns ± 2% +47.83% (p=0.016 n=4+5)
wuffs_strconv_parse_number_f64_pi_short/clang5 35.0ns ± 3% 18.0ns ± 0% -48.57% (p=0.008 n=5+5)
wuffs_strconv_parse_number_f64_1_lsh53_add0/gcc7 67.0ns ± 0% 34.0ns ± 0% -49.25% (p=0.000 n=5+4)
wuffs_strconv_parse_number_f64_1_lsh53_add1/gcc7 712ns ± 0% 760ns ± 2% +6.72% (p=0.008 n=5+5)
wuffs_strconv_parse_number_f64_pi_long/gcc7 88.4ns ± 1% 116.2ns ± 3% +31.45% (p=0.008 n=5+5)
wuffs_strconv_parse_number_f64_pi_short/gcc7 32.6ns ± 2% 21.4ns ± 7% -34.36% (p=0.008 n=5+5)
2020-07-07 15:27:51 +10:00
Nigel Tao
1bc98b6035
Fix script/print-mpb-powers-of-10.go with -detail
2020-07-06 17:01:41 +10:00
Nigel Tao
267bfc8176
Deepen parse_number_f64's powers_of_10 table
...
Deepen means changing the mantissa from 64 bits to 128 bits. We also
adjust the exponent bias, in anticipation of a future commit.
Binary size, before:
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
After:
27336 gen/lib/c/clang-5.0-dynamic/wuffs-base-f64conv.lo
27528 gen/lib/c/clang-5.0-static/wuffs-base-f64conv.o
28856 gen/lib/c/gcc-dynamic/wuffs-base-f64conv.lo
28856 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.432s
real 0m1.421s
citylots.json is from github.com/zemirco/sf-city-lots-json
2020-07-05 19:03:37 +10:00
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
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
0eee231ce6
Add script/process-json-numbers.c
2020-07-03 12:48:37 +10:00
Nigel Tao
89ceb9fabc
Add wuffs_base__render_number_f64
2020-07-01 12:03:20 +10:00