Commit Graph
90 Commits
Author SHA1 Message Date
Nigel Tao 2f78804e62 Use more inclusive language 2021-01-23 19:50:47 +11:00
Nigel Tao 904004e79a Let non-strict JSON Pointer syntax allow "~t" 2020-11-15 20:56:04 +11:00
Nigel Tao cd4cbc9102 Tweak JSON trailing comment/new-line quirks 2020-09-22 23:03:49 +10:00
Nigel Tao fa50f4de67 Add json QUIRK_ALLOW_TRAILING_COMMENT 2020-09-21 11:24:22 +10:00
Nigel Tao b55d539d94 Add links to jsonptr blog post 2020-09-11 08:11:02 +10:00
Nigel Tao 63e6796896 Add "4Ki tokens is 32KiB" comment 2020-08-26 00:00:32 +10:00
Nigel Tao 75682548f5 Add example/jsonptr -output-inf-nan-numbers flag 2020-08-22 21:40:18 +10:00
Nigel Tao ade016523b 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
2020-08-21 15:57:51 +10:00
Nigel Tao 3f688b2677 Optimize example/jsonptr token VBD switch
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
2020-08-21 15:51:48 +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 50db4a47fb Inline example/jsonptr's handle_token
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.911s
After:
real    0m1.799s
Ratio: 1.06x
2020-08-20 11:31:28 +10:00
Nigel Tao 2104205d25 Let example/jsonptr output comments
Performance (on vanilla, comment-free JSON) slips a little.

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.863s
After:
real    0m1.911s
Ratio: 0.97x   Inverse: 1.03x
2020-08-20 11:14:29 +10:00
Nigel Tao 6b86cbcb25 Optimize example/jsonptr's write_dst
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.949s
After:
real    0m1.863s
Ratio: 1.05x
2020-08-19 15:53:06 +10:00
Nigel Tao 991bd51306 Rename some example/jsonptr variables 2020-08-19 09:38:16 +10:00
Nigel Tao 0a0c7d68aa Optimize example/*json*'s indentation output
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    0m3.612s
After:
real    0m1.949s
Ratio: 1.85x
2020-08-19 00:02:30 +10:00
Nigel Tao 0291a47dc8 Remove example/jsonptr's ability to speak CBOR
Originally, the example/jsonptr program read JSON from stdin and wrote
JSON to stdout. Over the course of numerous recent commits, it gained
the ability to read either CBOR or JSON and write either CBOR or JSON.
(CBOR is, very roughly, a binary file format similar to the JSON text
file format). While a useful feature, the extra code hurt JSON-to-JSON
performance, the original motivating purpose of that program. This
commit reverts that feature, re-gaining original performance. (The
example/cbor-to-json and example/json-to-cbor programs were recently
added to convert between CBOR and JSON, covering that feature loss).

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	0m5.095s
After:
real	0m3.583s
Ratio: 1.42x

$ sloccount example/jsonptr/jsonptr.cc | grep ^cpp
Before this commit:
cpp:           1508 (100.00%)
After:
cpp:            869 (100.00%)
Ratio: 1.74x

This commit brings jsonptr.cc approximately to its state just before
168f60a7 "Add example/jsonptr -output-format=cbor flag" was committed,
although it keeps the flags added since then for allowing comments and
inf/NaN numbers.
2020-08-13 22:58:59 +10:00
Nigel Tao 484c1d5fc3 Delete unused MAX_INDENT definition 2020-08-09 23:11:06 +10:00
Nigel Tao 50bfab9998 Tweak example/*/*.cc compile instructions 2020-08-05 11:39:09 +10:00
Nigel Tao 0a68f6332a Have jsonptr pass through CBOR floating points 2020-07-28 10:39:32 +10:00
Nigel Tao c96b31c7bf Suppress jsonptr byte string output when in query 2020-07-27 23:07:49 +10:00
Nigel Tao 77c7551b26 Fix jsonptr whitespace and commas for CBOR tags 2020-07-27 21:35:11 +10:00
Nigel Tao 35c4e9532b Fix jsonptr's JSON output for CBOR simple values 2020-07-27 18:01:05 +10:00
Nigel Tao 983a74f257 Let jsonptr accept integer CBOR map keys 2020-07-27 15:56:56 +10:00
Nigel Tao ee6927fcdb Have jsonptr pass around slice_u8 more often 2020-07-27 12:08:33 +10:00
Nigel Tao d6a10dfe8a Add io_buffer.{read,writ}er_slice methods 2020-07-27 11:47:47 +10:00
Nigel Tao ea53245441 Have jsonptr base64url encode CBOR byte strings 2020-07-27 00:03:00 +10:00
Nigel Tao dd114696d8 Let jsonptr output inf and NaN 2020-07-25 21:55:30 +10:00
Nigel Tao 5a616b6693 Have std/cbor parse floating point numbers 2020-07-24 23:54:52 +10:00
Nigel Tao c9e2010040 Tweak std/cbor TOKEN_VALUE_MINOR__ETC bits 2020-07-24 23:19:12 +10:00
Nigel Tao 042e94f304 Have std/cbor parse simple values 2020-07-24 23:14:27 +10:00
Nigel Tao 271680333e Have std/cbor parse tags 2020-07-24 15:54:44 +10:00
Nigel Tao f8dfc76310 Have std/cbor parse objects 2020-07-24 11:41:22 +10:00
Nigel Tao 702c7b299f Let wuffs_base__utf_8__etc take ptr-to-const-u8 2020-07-22 15:42:54 +10:00
Nigel Tao 03a87ea3ef Add jsonptr check for to-be-extended token length 2020-07-21 23:29:26 +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 51a38295b6 Let jsonptr accept inf and NaN 2020-07-19 22:47:34 +10:00
Nigel Tao 7cb7654a4d Re-organize jsonptr.cc 2020-07-19 22:19:04 +10:00
Nigel Tao d191a3fc5f Have std/cbor parse text strings 2020-07-19 22:17:48 +10:00
Nigel Tao 3c8589b6e9 Let jsonptr output CBOR metadata as JSON comments 2020-07-19 21:49:00 +10:00
Nigel Tao af75772cc2 Have std/cbor parse byte strings 2020-07-18 17:27:11 +10:00
Nigel Tao 664f8431d2 Have std/cbor parse negative integers 2020-07-16 21:25:14 +10:00
Nigel Tao 4e193599ac Add std/cbor 2020-07-15 14:08:37 +10:00
Nigel Tao 168f60a781 Add example/jsonptr -output-format=cbor flag 2020-07-14 15:57:05 +10:00
Nigel Tao cd183f92b0 Fix jsonptr start_of_token_chain initial value 2020-07-14 12:11:05 +10:00
Nigel Tao ecadf72e6b Rename some example/json* flags 2020-07-13 08:25:59 +10:00
Nigel Tao c766bb72d6 Have example/jsonetc read and write extra commas 2020-07-09 13:15:36 +10:00
Nigel Tao 6b7ce30e32 Add wuffs_base__parse_number_xxx options arg 2020-07-07 16:19:46 +10:00
Nigel Tao 496e88b6c5 Remove wuffs_base__token__link_prev 2020-04-09 22:11:08 +10:00
Nigel Tao 2ef3999d6d Remove use of wuffs_base__token__link_prev 2020-04-09 17:24:39 +10:00