Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`fastJsonNode` is strongly refactored and optimized. Code is simpler, consumes less memory and executes faster. Changes: - slices used instead of maps - unified `attrs` and `children` containers into one (`attrs`), removed fastJsonAttr type - (min-)heap used instead of sorting - much simplified processing (because of single container in `fastJsonNode`) Performance comparison - artificial test (committed to `query/outputnode_test.go`), times measured without profiler. Memory measured (for entire test execution, including all setup) with default profiler configuration (because `-memprofilerate=1` was much too slow). | Branch | `master` | `improve/encode_meomry` | Improvement | |------- -------|----------|-------------------------|-------------| | Time: | 172.283s | 0.336s | > 512 x | | Total memory" | 43.65GB | 283.30MB | > 157 x | In fact, memory improvement for encode function is much bigger - encode doesn't allocate memory. `fastJsonNode` creation is also much cheaper (in terms of memory). This commit resolves #982, resolves #1138 and closes #1227.
- Loading branch information