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

Performance improvements #17

Merged
merged 12 commits into from
Oct 18, 2021
Merged

Performance improvements #17

merged 12 commits into from
Oct 18, 2021

Conversation

krynju
Copy link
Owner

@krynju krynju commented Oct 17, 2021

Things checked out:

  • replace isnothing 6s -> 5.18s
  • add additional dispatch in rotations 5.18s -> 3.7s
  • barriers on rebalance, more type stability on insert: now at 2.52s
  • more things: now at 1.87s

benchmark

using BenchmarkTools, AVLTrees
m=1000
n=1000

function testbase5(m, n)
    tree = AVLTrees.AVLSet{Int}()
    for i in 1:m
        for j in 1:n
            push!(tree, j)
            push!(tree, -j)
        end
        @assert !(0 in tree)
        for j in 1:n
            @assert j in tree
            @assert -j in tree
        end
        @assert !(n + 1 in tree)
        @assert !(-n - 1 in tree)
        for j in 1:n
            @assert j in tree
            @assert -j in tree
            delete!(tree, j)
            delete!(tree, -j)
            @assert !(j in tree)
            @assert !(-j in tree)
        end
    end
end

@btime testbase5(m,n)

@codecov
Copy link

codecov bot commented Oct 17, 2021

Codecov Report

Merging #17 (83614e4) into master (ba274f2) will increase coverage by 0.47%.
The diff coverage is 100.00%.

❗ Current head 83614e4 differs from pull request most recent head 43a6ccb. Consider uploading reports for the commit 43a6ccb to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
+ Coverage   91.05%   91.52%   +0.47%     
==========================================
  Files           4        4              
  Lines         257      295      +38     
==========================================
+ Hits          234      270      +36     
- Misses         23       25       +2     
Impacted Files Coverage Δ
src/set.jl 97.22% <100.00%> (+0.16%) ⬆️
src/tree.jl 90.87% <100.00%> (+0.59%) ⬆️

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 ba274f2...43a6ccb. Read the comment docs.

@krynju krynju mentioned this pull request Oct 17, 2021
@krynju krynju force-pushed the kr/performance_improvements_1 branch from 4ff6745 to 43a6ccb Compare October 18, 2021 18:14
@krynju krynju merged commit 88a6a93 into master Oct 18, 2021
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.

1 participant