mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
Optimize example/jsonptr string conversion
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
This commit is contained in:
1 parent
3f688b2677
commit
ade016523b
1 file changed
+1
-6
@@ -1199,14 +1199,9 @@ handle_token(wuffs_base__token t, bool start_of_token_chain) {
|
|||||||
g_query.is_at(g_depth));
|
g_query.is_at(g_depth));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vbd & WUFFS_BASE__TOKEN__VBD__STRING__CONVERT_0_DST_1_SRC_DROP) {
|
if (vbd & WUFFS_BASE__TOKEN__VBD__STRING__CONVERT_1_DST_1_SRC_COPY) {
|
||||||
// No-op.
|
|
||||||
} else if (vbd &
|
|
||||||
WUFFS_BASE__TOKEN__VBD__STRING__CONVERT_1_DST_1_SRC_COPY) {
|
|
||||||
TRY(write_dst(tok.ptr, tok.len));
|
TRY(write_dst(tok.ptr, tok.len));
|
||||||
g_query.incremental_match_slice(tok.ptr, tok.len);
|
g_query.incremental_match_slice(tok.ptr, tok.len);
|
||||||
} else {
|
|
||||||
return "main: internal error: unexpected string-token conversion";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t.continued()) {
|
if (t.continued()) {
|
||||||
|
|||||||
Reference in new issue
Block a user