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

optimize Chain.Ops() #99

Merged
merged 3 commits into from
May 12, 2021
Merged

optimize Chain.Ops() #99

merged 3 commits into from
May 12, 2021

Conversation

mmcloughlin
Copy link
Owner

Use linear 2SUM-like algorithm in the typical case where the chain is
ascending.

@codecov-commenter
Copy link

Codecov Report

Merging #99 (48ef593) into master (c4e8a5d) will increase coverage by 0.89%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #99      +/-   ##
==========================================
+ Coverage   70.80%   71.69%   +0.89%     
==========================================
  Files          29       29              
  Lines        1151     1166      +15     
==========================================
+ Hits          815      836      +21     
+ Misses        276      270       -6     
  Partials       60       60              
Flag Coverage Δ
unittests 71.69% <100.00%> (+0.89%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
chain.go 46.87% <100.00%> (+28.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4e8a5d...48ef593. Read the comment docs.

@mmcloughlin mmcloughlin merged commit 23389d5 into master May 12, 2021
@mmcloughlin mmcloughlin deleted the opt-chain-ops branch May 12, 2021 05:51
mmcloughlin added a commit that referenced this pull request May 13, 2021
The Approximation.Suggest() function is now the largest consumer in CPU profiles. Like #99 it is currently "accidentally cubic" but can be optimized to use a linear outer loop, similar to the 2-SUM problem.

Updates #60
Updates #25
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