Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose MaxPrefixPerNode as var #8

Merged
merged 1 commit into from
Jun 26, 2014
Merged

Conversation

LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Jun 26, 2014

Changing this variable can have a huge impact on performance in some cases.
We in moby/moby#6657 want to use your package and because all strings that we want to store have length 64 it will be pretty cool have ability to change MaxPrefixPerNode.
Here benchmarks for our TruncIndex:

bin/benchcmp prefix_10.txt prefix_64.txt                                                                    
benchmark                        old ns/op     new ns/op     delta       
BenchmarkTruncIndexAdd100        519957        175700        -66.21%     
BenchmarkTruncIndexAdd250        1401300       522519        -62.71%     
BenchmarkTruncIndexAdd500        2938667       1047919       -64.34%     
BenchmarkTruncIndexGet100        165660        127577        -22.99%     
BenchmarkTruncIndexGet250        436459        333950        -23.49%     
BenchmarkTruncIndexGet500        920812        691175        -24.94%     
BenchmarkTruncIndexDelete100     101162        96131         -4.97%      
BenchmarkTruncIndexDelete250     319886        230664        -27.89%     
BenchmarkTruncIndexDelete500     524306        504612        -3.76%      
BenchmarkTruncIndexNew100        499847        160208        -67.95%     
BenchmarkTruncIndexNew250        1350024       464970        -65.56%     
BenchmarkTruncIndexNew500        2856532       990191        -65.34%     
BenchmarkTruncIndexAddGet100     3944896       1717451       -56.46%     
BenchmarkTruncIndexAddGet250     3932681       1711997       -56.47%     
BenchmarkTruncIndexAddGet500     4776814       1707048       -64.26%     

benchmark                        old allocs     new allocs     delta       
BenchmarkTruncIndexAdd100        2352           528            -77.55%     
BenchmarkTruncIndexAdd250        5926           1395           -76.46%     
BenchmarkTruncIndexAdd500        11922          2870           -75.93%     
BenchmarkTruncIndexGet100        746            700            -6.17%      
BenchmarkTruncIndexGet250        1854           1752           -5.50%      
BenchmarkTruncIndexGet500        3665           3504           -4.39%      
BenchmarkTruncIndexDelete100     100            100            +0.00%      
BenchmarkTruncIndexDelete250     250            250            +0.00%      
BenchmarkTruncIndexDelete500     500            500            +0.00%      
BenchmarkTruncIndexNew100        2353           542            -76.97%     
BenchmarkTruncIndexNew250        5928           1382           -76.69%     
BenchmarkTruncIndexNew500        11927          2894           -75.74%     
BenchmarkTruncIndexAddGet100     15557          6360           -59.12%     
BenchmarkTruncIndexAddGet250     15568          6415           -58.79%     
BenchmarkTruncIndexAddGet500     15535          6332           -59.24%     

benchmark                        old bytes     new bytes     delta       
BenchmarkTruncIndexAdd100        136011        35583         -73.84%     
BenchmarkTruncIndexAdd250        352186        107216        -69.56%     
BenchmarkTruncIndexAdd500        708310        215194        -69.62%     
BenchmarkTruncIndexGet100        34871         31603         -9.37%      
BenchmarkTruncIndexGet250        86654         79138         -8.67%      
BenchmarkTruncIndexGet500        171168        158924        -7.15%      
BenchmarkTruncIndexDelete100     6400          6400          +0.00%      
BenchmarkTruncIndexDelete250     16000         16000         +0.00%      
BenchmarkTruncIndexDelete500     32000         32000         +0.00%      
BenchmarkTruncIndexNew100        134680        36252         -73.08%     
BenchmarkTruncIndexNew250        352005        104199        -70.40%     
BenchmarkTruncIndexNew500        710087        216844        -69.46%     
BenchmarkTruncIndexAddGet100     876360        375975        -57.10%     
BenchmarkTruncIndexAddGet250     876118        376951        -56.97%     
BenchmarkTruncIndexAddGet500     873994        372933        -57.33%     

Changing this variable can have a huge impact on performance in some
cases.
@tchap
Copy link
Owner

tchap commented Jun 26, 2014

Sure, no problem, thanks :-)

The question is if it would not make sense to make the parameter somehow specified to every trie, but...

tchap added a commit that referenced this pull request Jun 26, 2014
@tchap tchap merged commit f64d0a6 into tchap:master Jun 26, 2014
@tchap
Copy link
Owner

tchap commented Jun 26, 2014

@LK4D4 You can add yourself into AUTHORS if you want, although you know, it's more or less informational, I don't have a legal department ;-)

@LK4D4 LK4D4 deleted the var_max_prefix_per_node branch June 27, 2014 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants