dprint/jsonc-parser

Reference the original string as much as possible

Closed this issue · 1 comments

This should be changed to point at the original string as much as possible. Before doing this though, benchmarks should be created in #9.

Before

test citm_catalog_json_large_ast   ... bench: 133,134,700 ns/iter (+/- 16,091,411)
test citm_catalog_json_large_value ... bench: 169,842,450 ns/iter (+/- 16,535,443)
test package_json_ast              ... bench:     171,227 ns/iter (+/- 10,148)
test package_json_value            ... bench:     210,643 ns/iter (+/- 5,315)
test tsconfig_json_ast             ... bench:      52,583 ns/iter (+/- 2,214)
test tsconfig_json_value           ... bench:      54,320 ns/iter (+/- 2,087)

After

test citm_catalog_json_large_ast   ... bench:  89,828,260 ns/iter (+/- 22,361,753)
test citm_catalog_json_large_value ... bench: 130,511,540 ns/iter (+/- 6,573,763)
test package_json_ast              ... bench:     102,574 ns/iter (+/- 4,424)
test package_json_value            ... bench:     153,186 ns/iter (+/- 7,433)
test tsconfig_json_ast             ... bench:      33,891 ns/iter (+/- 1,387)
test tsconfig_json_value           ... bench:      35,100 ns/iter (+/- 4,114)

The GitHub action benchmarks are almost useless sadly... so much variance.