Commit Graph
844 Commits
Author SHA1 Message Date
Nigel Tao 76e6872498 Have clang-cl ignore unused-function etc warnings 2021-06-25 13:51:27 +10:00
Nigel Tao 543ac9af28 Restrict "ignore -Wold-style-cast" to C++ 2021-04-02 22:43:55 +11:00
Nigel Tao 97e30c29da Add some more #pragma's for GCC to ignore warnings 2021-04-02 19:21:54 +11:00
Nigel Tao ad40102c5a Change mimic marker symbol from "!!" to "¿" 2021-03-25 22:22:27 +11:00
Nigel Tao bb2e9e90b5 Change cgen marker symbol from "!!" to "¡" 2021-03-25 22:17:26 +11:00
Nigel Tao 61635213cd Add "‼" to "WUFFS C HEADER ENDS HERE" comment 2021-03-25 14:11:23 +11:00
Nigel Tao f2ed33375c Gate wuffs_aux on WUFFS_BASE__HAVE_UNIQUE_PTR 2021-03-11 10:52:49 +11:00
Nigel Tao 2f2bbc6ab0 Rename default github.com branch s/master/main/ 2021-01-25 11:30:15 +11:00
Nigel Tao 2f78804e62 Use more inclusive language 2021-01-23 19:50:47 +11:00
Nigel Tao 592560e0f1 Upgrade default clang C compiler from v5 to v9 2020-08-21 14:18:26 +10:00
Nigel Tao cf6c578973 Add aux library 2020-08-04 23:43:38 +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 533b84b3b1 Simplify WUFFS_VERSION_ETC macros 2020-06-11 23:01:50 +10:00
Nigel Tao b1ea22045a Stop dumbindent adding or removing line breaks 2020-06-10 21:51:25 +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 22d08366c8 Add dumbindent algorithm comment 2020-06-08 23:25:08 +10:00
Nigel Tao 2858c4cfc2 Add dumbindent.Options (tabs vs spaces) 2020-06-07 21:59:53 +10:00
Nigel Tao 53d5f5155c Have dumbindent break after some '{' and ';'s 2020-06-07 21:52:24 +10:00
Nigel Tao 6424bae087 Have dumbindent handle multi-line strings/comments
Fixes #31
2020-06-06 22:32:39 +10:00
Nigel Tao 3d7af06727 Have dumbindent take a dst slice argument 2020-06-06 21:09:41 +10:00
Nigel Tao dd04d55417 Update dumbindent comparison for clang-format-9 2020-06-05 18:35:05 +10:00
Nigel Tao d5d4da0ab6 Add some "// --------" section-break comments 2020-06-05 00:10:31 +10:00
Nigel Tao 8cd39fc1dd Remove -cformatter flag 2020-06-05 00:08:05 +10:00
Nigel Tao 12b0f4c0bc Change the default -cformatter to dumbindent
A follow-up commit will remove the -cformatter flag entirely.

Formatting the generated C code is now a small fraction of where "wuffs
gen" spends its time.

----
$ # Before.
$ time wuffs gen > /dev/null
real	0m0.932s
user	0m0.837s
sys	0m0.187s

$ # After.
$ time wuffs gen > /dev/null
real	0m0.186s
user	0m0.170s
sys	0m0.069s

$ time wuffs gen -cformatter= > /dev/null
real	0m0.184s
user	0m0.170s
sys	0m0.059s
----
2020-06-04 23:59:20 +10:00
Nigel Tao d8cd72798a Add {cmd,lib}/dumbindent 2020-06-04 23:35:11 +10:00
Nigel Tao 3efb204f4e Drop wuffs-c genrelease's exec of the C-formatter
genrelease essentially concatenates the individual packages' generated C
files, which should already be formatted.

----
$ # Before.
$ time wuffs gen > /dev/null
real	0m2.622s
user	0m2.457s
sys	0m0.266s

$ # After.
$ time wuffs gen > /dev/null
real	0m1.433s
user	0m1.335s
sys	0m0.191s
----
2020-06-03 13:46:24 +10:00
Nigel Tao 16c1f3cfd7 Clean up some wuffs-c output (before clang-format) 2020-06-03 13:36:04 +10:00
Nigel Tao ddc8973ef0 Let wuffs-c take a no-op C formatter
Reinforcing the previous commit's (e5cc4a42) observation, over 93% of
compilation time (converting foo.wuffs into foo.c) is spent piping the
generated C code through clang-format.

----
$ time wuffs gen -cformatter=clang-format-5.0 > /dev/null
real	0m2.855s
user	0m2.680s
sys	0m0.286s

$ time wuffs gen -cformatter=                 > /dev/null
real	0m0.175s
user	0m0.172s
sys	0m0.050s
----
2020-06-03 13:21:53 +10:00
Nigel Tao e5cc4a42e4 Measure how much of "wuffs gen" is clang-format
----
$ time wuffs gen
       1 milliseconds generating the C code
     753 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-base.c
       0 milliseconds generating the C code
      19 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-adler32.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/adler32.wuffs
       1 milliseconds generating the C code
      61 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-bmp.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/bmp.wuffs
       1 milliseconds generating the C code
      78 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-crc32.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/crc32.wuffs
       2 milliseconds generating the C code
      93 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-deflate.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/deflate.wuffs
       0 milliseconds generating the C code
      34 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-lzw.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/lzw.wuffs
       4 milliseconds generating the C code
     203 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-gif.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/gif.wuffs
       0 milliseconds generating the C code
      33 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-gzip.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/gzip.wuffs
       4 milliseconds generating the C code
     135 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-json.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/json.wuffs
       0 milliseconds generating the C code
      44 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-wbmp.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/wbmp.wuffs
       0 milliseconds generating the C code
      32 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-zlib.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/zlib.wuffs
       3 milliseconds collecting the C code
    1173 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/release/c/wuffs-unsupported-snapshot.c

real	0m2.849s
user	0m2.674s
sys	0m0.278s
----
2020-06-03 12:30:47 +10:00
Nigel Tao 092b03cd1e Add WUFFS_CONFIG__MODULE__BASE__ETC sub-modules
$ ls -l gen/lib/c/*/{lib*,*base*} | awk '{print $5 " " $9}'

Before:
167976 gen/lib/c/clang-5.0-dynamic/libwuffs.so
 40824 gen/lib/c/clang-5.0-dynamic/wuffs-base.lo
203306 gen/lib/c/clang-5.0-static/libwuffs.a
 41816 gen/lib/c/clang-5.0-static/wuffs-base.o
188080 gen/lib/c/gcc-dynamic/libwuffs.so
 53976 gen/lib/c/gcc-dynamic/wuffs-base.lo
230002 gen/lib/c/gcc-static/libwuffs.a
 53976 gen/lib/c/gcc-static/wuffs-base.o

After:
168024 gen/lib/c/clang-5.0-dynamic/libwuffs.so
 20664 gen/lib/c/clang-5.0-dynamic/wuffs-base-core.lo
 10784 gen/lib/c/clang-5.0-dynamic/wuffs-base-f64conv.lo
 11640 gen/lib/c/clang-5.0-dynamic/wuffs-base-pixconv.lo
205752 gen/lib/c/clang-5.0-static/libwuffs.a
 20960 gen/lib/c/clang-5.0-static/wuffs-base-core.o
 11024 gen/lib/c/clang-5.0-static/wuffs-base-f64conv.o
 12096 gen/lib/c/clang-5.0-static/wuffs-base-pixconv.o
188128 gen/lib/c/gcc-dynamic/libwuffs.so
 18936 gen/lib/c/gcc-dynamic/wuffs-base-core.lo
 10672 gen/lib/c/gcc-dynamic/wuffs-base-f64conv.lo
 27232 gen/lib/c/gcc-dynamic/wuffs-base-pixconv.lo
232984 gen/lib/c/gcc-static/libwuffs.a
 18920 gen/lib/c/gcc-static/wuffs-base-core.o
 10640 gen/lib/c/gcc-static/wuffs-base-f64conv.o
 27216 gen/lib/c/gcc-static/wuffs-base-pixconv.o
2020-05-25 23:01:11 +10:00
Nigel Tao 532e18c4a5 Add colons to const syntax 2020-04-14 14:57:30 +10:00
Nigel Tao 1a1f36ce13 Disable clang's -Wunreachable-code warning 2020-04-03 21:57:49 +11:00
Nigel Tao 097e59853d Tweak cmd/wuffsfmt/main.go 2020-02-05 17:16:49 +11:00
Nigel Tao ea54c2ea11 Add syntax support for implementing interfaces 2020-01-09 15:45:29 +11:00
Nigel Tao e7fb1558de Clarify wuffsfmt ignores . in paths not contents 2019-12-18 15:26:46 +11:00
Nigel Tao ad787cba11 Change ractool default codec from zlib to zstd 2019-12-11 10:21:29 +11:00
Nigel Tao 03f0d84a3a Remove -Werror from "wuffs test/bench" 2019-11-30 15:32:05 +11:00
Nigel Tao bd96dad333 Update ractool's numbers for zstd-with-dictionary 2019-10-25 11:18:48 +11:00
Nigel Tao 3b466277dc Fix "wuffs gen" null pointer dereference 2019-10-22 08:31:53 +11:00
Nigel Tao 7d76140429 Have "wuffs genlib" take a -ccompilers arg 2019-10-19 16:32:07 +11:00
Nigel Tao 1520a1f345 Rename x T to x: T for fields and func args 2019-10-12 21:49:04 +11:00
Nigel Tao d501daddc3 Rename [i..j] to [i ..= j], the same as Rust 2019-10-12 18:40:53 +11:00
Nigel Tao b4808596ac Add a ractool -tmpdir flag 2019-09-28 11:40:57 +10:00
Nigel Tao ac7f476c25 Fix cmd/ractool doc typo 2019-09-15 19:49:34 +10:00
Nigel Tao ee4904f1f4 Update cmd/ractool performance numbers 2019-09-15 15:36:15 +10:00
Nigel Tao 7d4c042c49 Add cmd/ractool note about supported codecs 2019-09-15 14:29:44 +10:00
Nigel Tao 00b6d22333 Add a lib/raclz4 package 2019-09-15 14:13:45 +10:00
Nigel Tao 996cb765b9 Add RAC+Zstd support to cmd/ractool 2019-09-14 12:58:42 +10:00
Nigel Tao fed2073b00 Have lib/raczlib use lib/cgozlib
As the cmd/ractool comment changes say, this is almost a 2x speed-up for
RAC+Zlib decoding on the enwik8 test file, comparable to the cgozlib
benchmark numbers:

$ go test -test.bench=. github.com/google/wuffs/lib/cgozlib
goos: linux
goarch: amd64
pkg: github.com/google/wuffs/lib/cgozlib
BenchmarkCgo-56     	    2514	    477230 ns/op
BenchmarkPure-56    	    1090	   1080853 ns/op
2019-09-07 11:35:48 +10:00