Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Replaces O(n^2) processing loop with a set. I benchmarked parsing a file with a single 5000 key hash to test this change's performance. Before: **Before** ```sh $ hyperfine --warmup 3 'bin/ruby-parse hash_bench.rb' Benchmark 1: bin/ruby-parse hash_bench.rb Time (mean ± σ): 2.678 s ± 0.029 s [User: 2.613 s, System: 0.061 s] Range (min … max): 2.636 s … 2.738 s 10 runs ``` **After** ```sh $ hyperfine --warmup 3 'bin/ruby-parse hash_bench.rb' Benchmark 1: bin/ruby-parse hash_bench.rb Time (mean ± σ): 421.3 ms ± 4.1 ms [User: 366.9 ms, System: 49.9 ms] Range (min … max): 414.8 ms … 426.1 ms 10 runs ``` - See whitequark#918
- Loading branch information