They don't work for me (on Debian bullseye). For example, from the
example/sdl-imageviewer directory:
$ make
g++ -lSDL2 -lSDL2_image sdl-imageviewer.cc -o sdl-imageviewer
/usr/bin/ld: /tmp/cciX1mj2.o: in function `draw(SDL_Window*)':
sdl-imageviewer.cc:(.text+0x36e44): undefined reference to `SDL_GetWindowSurface'
/usr/bin/ld: sdl-imageviewer.cc:(.text+0x36e69): undefined reference to `SDL_CreateRenderer'
/usr/bin/ld: sdl-imageviewer.cc:(.text+0x36e79): undefined reference to `SDL_RenderClear'
etc
collect2: error: ld returned 1 exit status
make: *** [<builtin>: sdl-imageviewer] Error 1
Swapping the g++ args around to
g++ sdl-imageviewer.cc -lSDL2 -lSDL2_image -o sdl-imageviewer
works, but the recommended approach is to use the existing top-level
build-example.sh script instead.
Before this commit, line-comment token chains included the final "\n"
the way block-comments included the final "*/". The "\n" was mandatory.
However, when parsing with both QUIRK_ALLOW_COMMENT_LINE and
QUIRK_ALLOW_TRAILING_FILLER, input like "123//xyz" (without a "\n"
before the EOF) was rejected before and accepted after this commit.
So that line-comments are consistent, in that they either always or
never include the final "\n", they now never include the final "\n".
An input fragment (parsed with QUIRK_ALLOW_COMMENT_LINE) like
"//abc\n\t\t" was, before this commit, parsed as a 6 byte comment token
and a 2 byte other-filler token. That split is now 5+3.
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-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real 0m7.333s
After:
real 0m5.970s
Ratio: 1.23x
Using "/usr/bin/time -v" instead of "time"
Before this commit:
Maximum resident set size (kbytes): 2556992
After:
Maximum resident set size (kbytes): 1214812
Ratio: 2.10x
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-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real 0m7.550s
After:
real 0m7.333s
Ratio: 1.03x
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-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real 0m8.822s
After:
real 0m7.550s
Ratio: 1.17x
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-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real 0m9.774s
After:
real 0m8.822s
Ratio: 1.11x
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-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real 0m21.104s
After:
real 0m9.774s
Ratio: 2.16x
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.687s
After:
real 0m1.677s
Ratio: 1.01x
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.765s
After:
real 0m1.687s
Ratio: 1.05x