Skip to content
New issue

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

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

Already on GitHub? # to your account

Use fewer variables for perf improv??? #76

Closed
wants to merge 2 commits into from
Closed

Conversation

gonzedge
Copy link
Owner

@gonzedge gonzedge commented Dec 2, 2024

No description provided.

@gonzedge gonzedge force-pushed the gonzedge/fewer-vars branch from 5aa86d5 to d86c474 Compare December 2, 2024 01:24
@gonzedge
Copy link
Owner Author

gonzedge commented Dec 3, 2024

It actually doesn't make that much of a difference. Word diff:

==> Creation - `Rambling::Trie.create`
5 iterations -
                                [-2.542503   0.315882   2.858385-]{+2.530004   0.295954   2.825958+} (  [-2.858684)-]{+2.828177)+}

==> Compression - `compress!`
5 iterations -
                                [-1.648002   0.019028   1.667030-]{+1.658520   0.016983   1.675503+} (  [-1.667160)-]{+1.675590)+}

==> Serialization (raw trie) - `Rambling::Trie.load`
5 iterations -
                                [-1.634451   0.035992   1.670443-]{+1.643982   0.024962   1.668944+} (  [-1.670561)-]{+1.669116)+}

==> Serialization (compressed trie) - `Rambling::Trie.load`
5 iterations -
                                [-0.961647   0.009998   0.971645-]{+0.954673   0.006028   0.960701+} (  [-0.971783)-]{+0.960795)+}

==> Lookups (raw trie) - `word?`
200000 iterations - hi                  true
                                [-0.104449   0.002019   0.106468-]{+0.101404   0.002978   0.104382+} (  [-0.106484)-]{+0.104409)+}
200000 iterations - help                true
                                [-0.183814   0.003993   0.187807-]{+0.167495   0.004019   0.171514+} (  [-0.187814)-]{+0.171547)+}
200000 iterations - beautiful           true
                                [-0.372377   0.010976   0.383353-]{+0.335895   0.011000   0.346895+} (  [-0.383385)-]{+0.346924)+}
200000 iterations - impressionism       true
                                [-0.516871   0.014997   0.531868-]{+0.479124   0.015971   0.495095+} (  [-0.531906)-]{+0.495184)+}
200000 iterations - anthropological     true
                                [-0.603869   0.015998   0.619867-]{+0.562920   0.024922   0.587842+} (  [-0.619997)-]{+0.590027)+}

==> Lookups (compressed trie) - `word?`
200000 iterations - hi                  true
                                [-0.158557   0.000024   0.158581-]{+0.160102   0.000005   0.160107+} (  [-0.158583)-]{+0.160125)+}
200000 iterations - help                true
                                [-0.278754-]{+0.282724+}   0.000000   [-0.278754-]{+0.282724+} (  [-0.278783)-]{+0.282742)+}
200000 iterations - beautiful           true
                                [-0.553362   0.006979   0.560341-]{+0.561552   0.007018   0.568570+} (  [-0.560387)-]{+0.568708)+}
200000 iterations - impressionism       true
                                [-0.827275   0.042007   0.869282-]{+0.836135   0.032968   0.869103+} (  [-0.869342)-]{+0.869231)+}
200000 iterations - anthropological     true
                                [-0.889524   0.037980   0.927504-]{+0.892980   0.054994   0.947974+} (  [-0.927551)-]{+0.948031)+}

==> Lookups (raw trie) - `partial_word?`
200000 iterations - hi                  true
                                [-0.098253   0.000011   0.098264-]{+0.094684   0.000000   0.094684+} (  [-0.098267)-]{+0.094706)+}
200000 iterations - help                true
                                [-0.171847   0.000001   0.171848-]{+0.157845   0.000000   0.157845+} (  [-0.171877)-]{+0.157852)+}
200000 iterations - beautiful           true
                                [-0.348744   0.000000   0.348744-]{+0.315336   0.000006   0.315342+} (  [-0.348770)-]{+0.315366)+}
200000 iterations - impressionism       true
                                [-0.485157-]{+0.453110+}   0.000000   [-0.485157-]{+0.453110+} (  [-0.485188)-]{+0.453196)+}
200000 iterations - anthropological     true
                                [-0.546613   0.000006   0.546619-]{+0.508400   0.000000   0.508400+} (  [-0.546661)-]{+0.508717)+}

==> Lookups (compressed trie) - `partial_word?`
200000 iterations - hi                  true
                                [-0.178687   0.000026   0.178713-]{+0.178137   0.000000   0.178137+} (  [-0.178718)-]{+0.178169)+}
200000 iterations - help                true
                                [-0.331221   0.002975   0.334196-]{+0.333249   0.000986   0.334235+} (  [-0.334228)-]{+0.334291)+}
200000 iterations - beautiful           true
                                [-0.690783   0.046985   0.737768-]{+0.701096   0.038000   0.739096+} (  [-0.737816)-]{+0.739167)+}
200000 iterations - impressionism       true
                                [-1.037524   0.101000   1.138524-]{+1.048228   0.087963   1.136191+} (  [-1.138661)-]{+1.136293)+}
200000 iterations - anthropological     true
                                [-1.068527   0.113960   1.182487-]{+1.053436   0.126001   1.179437+} (  [-1.182584)-]{+1.179498)+}

==> Lookups (raw trie) - `scan`
1000 iterations - hi                    495
                                [-1.091671   0.000001   1.091672-]{+1.071032   0.002970   1.074002+} (  [-1.091742)-]{+1.076769)+}
100000 iterations - help                20
                                [-4.984834   0.323960   5.308794-]{+5.024438   0.312956   5.337394+} (  [-5.309151)-]{+5.338083)+}
100000 iterations - beautiful           6
                                [-2.426180   0.240928   2.667108-]{+2.391498   0.249952   2.641450+} (  [-2.667307)-]{+2.641719)+}
200000 iterations - impressionism       2
                                [-2.210835   0.233959   2.444794-]{+2.188703   0.243863   2.432566+} (  [-2.445107)-]{+2.434815)+}
200000 iterations - anthropological     2
                                [-2.698757   0.265956   2.964713-]{+2.741640   0.268954   3.010594+} (  [-2.964892)-]{+3.010910)+}

==> Lookups (compressed trie) - `scan`
1000 iterations - hi                    495
                                [-0.728874   0.000003   0.728877-]{+0.731601   0.000000   0.731601+} (  [-0.728905)-]{+0.731651)+}
100000 iterations - help                20
                                [-2.784963   0.000030   2.784993-]{+2.810059   0.001024   2.811083+} (  [-2.785360)-]{+2.811332)+}
100000 iterations - beautiful           6
                                [-1.603243   0.075964   1.679207-]{+1.600757   0.073946   1.674703+} (  [-1.679377)-]{+1.677002)+}
200000 iterations - impressionism       2
                                [-2.252381   0.113018   2.365399-]{+2.234012   0.160990   2.395002+} (  [-2.365537)-]{+2.395190)+}
200000 iterations - anthropological     2
                                [-2.409384   0.097871   2.507255-]{+2.412415   0.096975   2.509390+} (  [-2.507402)-]{+2.509639)+}

==> Lookups (raw trie) - `words_within`
100000 iterations - ifdxawesome45someword319
                                [-3.577963   0.022839   3.600802-]{+3.577442   0.011004   3.588446+} (  [-3.607526)-]{+3.592607)+}
100000 iterations - ifdx45someword3awesome19
                                [-3.469056   0.004997   3.474053-]{+3.525877   0.003866   3.529743+} (  [-3.474323)-]{+3.530254)+}

==> Lookups (compressed trie) - `words_within`
100000 iterations - ifdxawesome45someword319
                                [-4.720862   0.139879   4.860741-]{+4.753573   0.126997   4.880570+} (  [-4.863257)-]{+4.882662)+}
100000 iterations - ifdx45someword3awesome19
                                [-5.387483   0.179993   5.567476-]{+5.373500   0.206983   5.580483+} (  [-5.568174)-]{+5.581052)+}

@gonzedge gonzedge closed this Dec 3, 2024
@gonzedge gonzedge deleted the gonzedge/fewer-vars branch December 3, 2024 02:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant