Commit Graph
781 Commits
Author SHA1 Message Date
Nigel Tao b81999f9fc Restrict an io_bind io arg to local variables only 2020-12-24 14:11:48 +11:00
Nigel Tao f6d11c78da Add ast.Expr IsArgsDotFoo and IsMethodCall methods 2020-12-23 15:13:14 +11:00
Nigel Tao 4a8acf968b Tighten valid const/func/struct names 2020-12-19 20:56:03 +11:00
Nigel Tao 8a12a64754 Add limited_swizzle_u32_interleaved_from_reader 2020-12-12 00:28:16 +11:00
Nigel Tao 0ccdece50a Add swizzle_interleaved_transparent_black 2020-12-04 22:53:59 +11:00
Nigel Tao 8482161c91 Add base.pixel_buffer.palette_or_else 2020-12-02 22:13:35 +11:00
Nigel Tao 4a5df43aeb Add PIXEL_FORMAT__BGRA_NONPREMUL_4X16LE
Binary size, before:
14272 gen/lib/c/clang-9-dynamic/wuffs-base-pixconv.lo
14760 gen/lib/c/clang-9-static/wuffs-base-pixconv.o
22336 gen/lib/c/gcc-dynamic/wuffs-base-pixconv.lo
22280 gen/lib/c/gcc-static/wuffs-base-pixconv.o

After:
18712 gen/lib/c/clang-9-dynamic/wuffs-base-pixconv.lo
19392 gen/lib/c/clang-9-static/wuffs-base-pixconv.o
36880 gen/lib/c/gcc-dynamic/wuffs-base-pixconv.lo
36824 gen/lib/c/gcc-static/wuffs-base-pixconv.o
2020-11-16 15:23:57 +11:00
Nigel Tao 43630d14f0 Make lang/ast Str methods return non-empty for nil 2020-11-09 21:39:50 +11:00
Nigel Tao 2dfe222681 Drop args- and this-related facts after ? call 2020-11-05 14:49:47 +11:00
Nigel Tao 1812bdb9bd Look for the wuffs root dir in CWD and ancestors
Updates #35
2020-09-03 22:08:05 +10:00
Nigel Tao fc304139af Add WUFFS_BASE__TOKEN__VBD__FILLER__COMMENT_ANY 2020-08-19 09:40:02 +10:00
Nigel Tao 4284369bb8 Add TOKEN__VBD__FILLER__PUNCTUATION 2020-08-17 16:48:30 +10:00
Nigel Tao 3c3d58bfe7 Rename io_writer.history_available 2020-08-13 23:29:59 +10:00
Nigel Tao be8542e313 Rename I/O available methods to length 2020-08-13 23:26:08 +10:00
Nigel Tao 79b923c322 Rename io_reader.available_valid_utf_8 2020-08-13 23:15:28 +10:00
Nigel Tao 70c42bff10 Break std/cbor string tokens on UTF-8 boundaries 2020-07-22 21:50:51 +10:00
Nigel Tao 850dc18d16 Have std/cbor produce extended inline integers 2020-07-21 22:52:04 +10:00
Nigel Tao c9d4e34dfc Split ETC__VBC__INLINE_INTEGER into {,un}signed 2020-07-21 15:31:49 +10:00
Nigel Tao 31674f9bd2 Let skip_u32_fast take non-constant arguments 2020-07-15 14:10:43 +10:00
Nigel Tao 4e193599ac Add std/cbor 2020-07-15 14:08:37 +10:00
Nigel Tao 15cc8502b1 Add token enums for base-32 codecs 2020-07-09 21:23:38 +10:00
Nigel Tao 309a5ba231 Add base_64 codec to wuffs_base 2020-07-09 20:42:17 +10:00
Nigel Tao b9afc26387 Add TOKEN__VBD__STRING__CHAIN_ETC 2020-07-03 13:36:13 +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 3d31ac03eb Add base.TOKEN__ETC constants 2020-06-09 23:34:42 +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 7e32336de0 Add base.PIXEL_FORMAT__ETC constants 2020-06-09 12:34:34 +10:00
Nigel Tao 71528b33dd Rename frame_config.update to frame_config.set 2020-06-03 11:34:57 +10:00
Nigel Tao 6c83516afa Ensure that you cannot return a suspension 2020-06-03 11:08:23 +10:00
Nigel Tao de1e274ad2 Remove io_reader.take 2020-06-02 23:08:24 +10:00
Nigel Tao 8b21a7600a Add swizzle_interleaved_from_reader 2020-06-02 23:04:22 +10:00
Nigel Tao 54196c4e80 Rename pixel_swizzler.swizzle_interleaved 2020-05-29 16:54:05 +10:00
Nigel Tao 6537a817b7 Roll back the two previous "@I/O redirect" commits
See the previous commit for the rationale.
2020-05-29 11:27:51 +10:00
Nigel Tao 49023afd48 Performance mystery: delete unused string constant
This commit deletes the definition of the `const char*
wuffs_base__note__i_o_redirect` global variable. This variable is not
used anywhere (after the previous commit removed references to it).

Deleting this one line of code (two if you count the declaration, not
just the definition) can have a dramatic effect on seemingly unrelated
performance micro-benchmarks. Some numbers get better (e.g. +5%), some
numbers get worse (e.g. -10%). The same micro-benchmark can get faster
on one C compiler but slower on another.

It is a mystery why this happens. This small, self-contained commit (as
well as the previous one, which set it up) will be immediately followed
by a roll back, but it is committed anyway so that we can refer to these
numbers in the git log. To reproduce:

----
$ git clone https://github.com/google/wuffs.git
$ cd wuffs
$ gcc --version | head -n 1
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

$ # Check out the parent commit.
$ git checkout --quiet THE_HASH_OF_THIS_COMMIT^
$ gcc -O3 -Wall -std=c99 test/c/std/json.c -DWUFFS_MIMIC
$ ./a.out -bench -focus=wuffs_json_decode_1k | grep MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1125 ns/op	     756.762 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1131 ns/op	     752.652 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1131 ns/op	     752.785 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1131 ns/op	     752.697 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1132 ns/op	     752.365 MB/s

$ # Check out this commit.
$ git checkout --quiet THE_HASH_OF_THIS_COMMIT
$ gcc -O3 -Wall -std=c99 test/c/std/json.c -DWUFFS_MIMIC
$ ./a.out -bench -focus=wuffs_json_decode_1k | grep MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1200 ns/op	     709.617 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1203 ns/op	     707.651 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1203 ns/op	     707.976 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1233 ns/op	     690.663 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1203 ns/op	     708.153 MB/s

$ # Dropping the "-std=c99" also changes the numbers.

$ # Check out the parent commit.
$ git checkout --quiet THE_HASH_OF_THIS_COMMIT^
$ gcc -O3 -Wall          test/c/std/json.c -DWUFFS_MIMIC
$ ./a.out -bench -focus=wuffs_json_decode_1k | grep MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1229 ns/op	     693.226 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1230 ns/op	     692.254 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1230 ns/op	     692.486 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1234 ns/op	     689.986 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1232 ns/op	     691.480 MB/s

$ # Check out this commit.
$ git checkout --quiet THE_HASH_OF_THIS_COMMIT
$ gcc -O3 -Wall          test/c/std/json.c -DWUFFS_MIMIC
$ ./a.out -bench -focus=wuffs_json_decode_1k | grep MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1129 ns/op	     754.103 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1131 ns/op	     752.849 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1135 ns/op	     750.622 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1150 ns/op	     740.731 MB/s
Benchmarkwuffs_json_decode_1k/gcc7	 1000000	    1135 ns/op	     750.609 MB/s

$ ldd ./a.out
	linux-vdso.so.1 (0x00007ffd9b1f2000)
	libgtk3-nocsd.so.0 => /usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007f9b46f60000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9b46b6f000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9b4696b000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9b4674c000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f9b5b59a000)
$ rm a.out
----

Some more benchmark numbers before/after this commit:

----
name                                                old speed      new speed      delta

wuffs_deflate_decode_1k_full_init/clang5             103MB/s ± 1%   105MB/s ± 1%   +2.25%  (p=0.000 n=9+10)
wuffs_deflate_decode_1k_part_init/clang5             121MB/s ± 0%   122MB/s ± 0%     ~     (p=1.000 n=9+9)
wuffs_deflate_decode_10k_full_init/clang5            148MB/s ± 1%   149MB/s ± 0%     ~     (p=0.059 n=9+8)
wuffs_deflate_decode_10k_part_init/clang5            151MB/s ± 0%   151MB/s ± 0%     ~     (p=0.968 n=9+10)
wuffs_deflate_decode_100k_just_one_read/clang5       172MB/s ± 0%   171MB/s ± 1%   -0.44%  (p=0.001 n=9+9)
wuffs_deflate_decode_100k_many_big_reads/clang5      149MB/s ± 0%   149MB/s ± 1%   -0.56%  (p=0.000 n=10+9)

wuffs_deflate_decode_1k_full_init/gcc7               104MB/s ± 1%   102MB/s ± 1%   -2.45%  (p=0.000 n=9+10)
wuffs_deflate_decode_1k_part_init/gcc7               121MB/s ± 0%   121MB/s ± 0%   +0.46%  (p=0.000 n=9+10)
wuffs_deflate_decode_10k_full_init/gcc7              147MB/s ± 0%   153MB/s ± 0%   +3.75%  (p=0.000 n=8+10)
wuffs_deflate_decode_10k_part_init/gcc7              150MB/s ± 1%   155MB/s ± 0%   +3.98%  (p=0.000 n=9+10)
wuffs_deflate_decode_100k_just_one_read/gcc7         184MB/s ± 0%   194MB/s ± 1%   +5.43%  (p=0.000 n=9+10)
wuffs_deflate_decode_100k_many_big_reads/gcc7        154MB/s ± 0%   158MB/s ± 0%   +2.45%  (p=0.000 n=9+10)

wuffs_gif_decode_1k_bw/clang5                        281MB/s ± 1%   278MB/s ± 1%   -0.92%  (p=0.003 n=10+9)
wuffs_gif_decode_1k_color_full_init/clang5          97.8MB/s ± 1%  93.7MB/s ± 3%   -4.26%  (p=0.000 n=10+10)
wuffs_gif_decode_1k_color_part_init/clang5           117MB/s ± 1%   115MB/s ± 1%   -1.41%  (p=0.000 n=9+10)
wuffs_gif_decode_10k_bgra/clang5                     463MB/s ± 1%   455MB/s ± 1%   -1.68%  (p=0.000 n=10+10)
wuffs_gif_decode_10k_indexed/clang5                  124MB/s ± 1%   121MB/s ± 1%   -2.31%  (p=0.000 n=9+9)
wuffs_gif_decode_20k/clang5                          149MB/s ± 1%   146MB/s ± 1%   -1.95%  (p=0.000 n=10+10)
wuffs_gif_decode_100k_artificial/clang5              313MB/s ± 1%   307MB/s ± 0%   -1.94%  (p=0.000 n=9+7)
wuffs_gif_decode_100k_realistic/clang5               135MB/s ± 1%   133MB/s ± 1%   -1.18%  (p=0.000 n=10+8)
wuffs_gif_decode_1000k_full_init/clang5              136MB/s ± 1%   132MB/s ± 4%   -2.27%  (p=0.023 n=10+10)
wuffs_gif_decode_1000k_part_init/clang5              136MB/s ± 1%   132MB/s ± 3%   -2.96%  (p=0.000 n=9+10)
wuffs_gif_decode_anim_screencap/clang5               644MB/s ± 1%   621MB/s ± 3%   -3.51%  (p=0.000 n=10+10)

wuffs_gif_decode_1k_bw/gcc7                          290MB/s ± 1%   287MB/s ± 1%   -1.18%  (p=0.000 n=10+10)
wuffs_gif_decode_1k_color_full_init/gcc7            91.7MB/s ± 1%  88.2MB/s ± 1%   -3.85%  (p=0.000 n=10+10)
wuffs_gif_decode_1k_color_part_init/gcc7             107MB/s ± 1%   103MB/s ± 1%   -4.12%  (p=0.000 n=9+10)
wuffs_gif_decode_10k_bgra/gcc7                       370MB/s ± 1%   344MB/s ± 1%   -6.98%  (p=0.000 n=10+9)
wuffs_gif_decode_10k_indexed/gcc7                    113MB/s ± 2%   104MB/s ± 1%   -8.31%  (p=0.000 n=10+8)
wuffs_gif_decode_20k/gcc7                            139MB/s ± 1%   127MB/s ± 3%   -8.49%  (p=0.000 n=10+10)
wuffs_gif_decode_100k_artificial/gcc7                299MB/s ± 0%   280MB/s ± 1%   -6.43%  (p=0.000 n=9+8)
wuffs_gif_decode_100k_realistic/gcc7                 123MB/s ± 1%   111MB/s ± 1%  -10.21%  (p=0.000 n=10+8)
wuffs_gif_decode_1000k_full_init/gcc7                124MB/s ± 1%   112MB/s ± 1%   -9.34%  (p=0.000 n=10+8)
wuffs_gif_decode_1000k_part_init/gcc7                125MB/s ± 1%   112MB/s ± 1%  -10.19%  (p=0.000 n=10+9)
wuffs_gif_decode_anim_screencap/gcc7                 622MB/s ± 1%   599MB/s ± 3%   -3.68%  (p=0.000 n=9+10)

wuffs_json_decode_1k/clang5                          628MB/s ± 1%   628MB/s ± 1%     ~     (p=0.842 n=9+10)
wuffs_json_decode_21k_formatted/clang5               331MB/s ± 1%   331MB/s ± 0%     ~     (p=0.720 n=10+9)
wuffs_json_decode_26k_compact/clang5                 521MB/s ± 1%   521MB/s ± 0%     ~     (p=0.549 n=10+9)
wuffs_json_decode_217k_stringy/clang5                432MB/s ± 1%   432MB/s ± 1%     ~     (p=0.780 n=10+9)

wuffs_json_decode_1k/gcc7                            745MB/s ± 0%   703MB/s ± 0%   -5.70%  (p=0.000 n=9+10)
wuffs_json_decode_21k_formatted/gcc7                 418MB/s ± 1%   400MB/s ± 1%   -4.44%  (p=0.000 n=10+8)
wuffs_json_decode_26k_compact/gcc7                   554MB/s ± 1%   511MB/s ± 1%   -7.72%  (p=0.000 n=9+10)
wuffs_json_decode_217k_stringy/gcc7                  452MB/s ± 1%   422MB/s ± 1%   -6.58%  (p=0.000 n=9+10)
----
2020-05-29 11:21:32 +10:00
Nigel Tao 91dcf8f582 Add io_reader.limited_copy_u32_to_slice 2020-05-27 23:47:10 +10:00
Nigel Tao 5a27e95cb8 Delete superfluous frame_config.duration comment 2020-05-27 23:31:31 +10:00
Nigel Tao 8b70ad0565 Rename skip32 to skip_u32 2020-05-27 23:29:20 +10:00
Nigel Tao 1ed0f89948 Rename copy_n32_etc to limited_copy_u32_etc 2020-05-27 19:55:06 +10:00
Nigel Tao dcb81a85bb Prepare to decode BMP embedding a JPEG or PNG 2020-05-27 13:37:54 +10:00
Nigel Tao 1239280ad8 Roll back 'dst_palette into the pixel_swizzler'
See the previous commit for the rationale.
2020-05-26 14:13:28 +10:00
Nigel Tao 2d8ec9ace9 Roll dst_palette into the pixel_swizzler struct
This commit will soon be followed by a rollback, but it is committed
anyway so that we can refer to these numbers in the git log.

name                                        old speed      new speed      delta

wuffs_gif_decode_1k_bw/clang5                286MB/s ± 1%   251MB/s ± 0%  -12.11%  (p=0.000 n=10+9)
wuffs_gif_decode_1k_color_full_init/clang5  96.0MB/s ± 0%  88.9MB/s ± 0%   -7.35%  (p=0.000 n=10+10)
wuffs_gif_decode_1k_color_part_init/clang5   119MB/s ± 0%   108MB/s ± 0%   -9.06%  (p=0.000 n=10+8)
wuffs_gif_decode_10k_bgra/clang5             469MB/s ± 1%   438MB/s ± 0%   -6.50%  (p=0.000 n=10+8)
wuffs_gif_decode_10k_indexed/clang5          125MB/s ± 1%   117MB/s ± 1%   -6.78%  (p=0.000 n=9+9)
wuffs_gif_decode_20k/clang5                  153MB/s ± 0%   139MB/s ± 0%   -9.40%  (p=0.000 n=9+9)
wuffs_gif_decode_100k_artificial/clang5      324MB/s ± 0%   304MB/s ± 0%   -6.22%  (p=0.000 n=10+9)
wuffs_gif_decode_100k_realistic/clang5       139MB/s ± 1%   125MB/s ± 1%   -9.69%  (p=0.000 n=9+10)
wuffs_gif_decode_1000k_full_init/clang5      141MB/s ± 0%   126MB/s ± 0%  -10.40%  (p=0.000 n=10+10)
wuffs_gif_decode_1000k_part_init/clang5      141MB/s ± 1%   126MB/s ± 0%  -10.50%  (p=0.000 n=10+8)
wuffs_gif_decode_anim_screencap/clang5       655MB/s ± 0%   617MB/s ± 1%   -5.91%  (p=0.000 n=9+9)

wuffs_gif_decode_1k_bw/gcc7                  299MB/s ± 0%   295MB/s ± 0%   -1.18%  (p=0.000 n=10+8)
wuffs_gif_decode_1k_color_full_init/gcc7    85.2MB/s ± 1%  88.2MB/s ± 0%   +3.58%  (p=0.000 n=10+10)
wuffs_gif_decode_1k_color_part_init/gcc7     104MB/s ± 0%   103MB/s ± 0%   -0.39%  (p=0.001 n=9+10)
wuffs_gif_decode_10k_bgra/gcc7               349MB/s ± 2%   352MB/s ± 0%   +0.77%  (p=0.000 n=9+10)
wuffs_gif_decode_10k_indexed/gcc7            106MB/s ± 0%   106MB/s ± 2%     ~     (p=0.762 n=8+10)
wuffs_gif_decode_20k/gcc7                    133MB/s ± 0%   133MB/s ± 0%     ~     (p=0.258 n=9+9)
wuffs_gif_decode_100k_artificial/gcc7        302MB/s ± 0%   301MB/s ± 1%   -0.41%  (p=0.035 n=10+10)
wuffs_gif_decode_100k_realistic/gcc7         118MB/s ± 1%   118MB/s ± 1%     ~     (p=0.095 n=9+10)
wuffs_gif_decode_1000k_full_init/gcc7        120MB/s ± 1%   119MB/s ± 0%   -0.34%  (p=0.007 n=10+10)
wuffs_gif_decode_1000k_part_init/gcc7        119MB/s ± 1%   119MB/s ± 1%     ~     (p=0.138 n=10+10)
wuffs_gif_decode_anim_screencap/gcc7         640MB/s ± 0%   640MB/s ± 0%     ~     (p=0.905 n=9+10)
2020-05-26 14:07:30 +10:00
Nigel Tao ad1cff3921 Add tell_me_more? mechanism 2020-05-12 11:12:39 +10:00
Nigel Tao 1f424b2ea7 Propagate const-values to idents of consts 2020-04-16 09:37:05 +10:00
Nigel Tao 532e18c4a5 Add colons to const syntax 2020-04-14 14:57:30 +10:00
Nigel Tao 4bc42db1d3 Add set_quirk_enabled interface methods 2020-04-12 20:53:54 +10:00
Nigel Tao 496e88b6c5 Remove wuffs_base__token__link_prev 2020-04-09 22:11:08 +10:00
Nigel Tao 161fa6ae4a Ban continue in a double-curly while loop 2020-04-03 12:23:57 +11:00