-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn on heap-based approach for 10x speed-up
The code is very rough. I just wanted to hack this in to prove the performance of it. Refactoring will follow to make it palatable. Nevertheless, the wins are nuts: Before (best of three runs): user system total real pathological 0.250000 0.000000 0.250000 ( 0.247176) command-t 1.980000 0.000000 1.980000 ( 1.982246) chromium (subset) 2.070000 0.200000 2.270000 ( 1.427773) chromium (whole) 9.970000 0.030000 10.000000 ( 6.186547) After (best of three runs): user system total real pathological 0.270000 0.010000 0.280000 ( 0.268869) command-t 1.410000 0.000000 1.410000 ( 1.420606) chromium (subset) 1.140000 0.160000 1.300000 ( 0.250876) chromium (whole) 4.880000 0.020000 4.900000 ( 0.679532) Of interest, note that the Chromium sets are *faster* than the much smaller Command-T set now. Presumably because this approach really benefits from threading[*], and only the Chromium sets are big enough to actually activate threaded search. [*]: I hadn't anticipated this, but is makes perfect sense. The bottleneck of the old approach was the sorting, and that could only happen on a single thread. The work done for the heaps, however, is distributed across threads, better leveraging the power of multiple cores. Still, even though I can explain all this and anticipated it, I am still wondering if if is too good to be true. The code was already optimized up the wazoo and this is a 10x speed up. I'll take it, anyway, because the tests pass and things feel right in use.
- Loading branch information
Showing
2 changed files
with
115 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters