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

individual operations extremely slow compared to environments #18

Open
kforner opened this issue Apr 30, 2018 · 0 comments
Open

individual operations extremely slow compared to environments #18

kforner opened this issue Apr 30, 2018 · 0 comments

Comments

@kforner
Copy link

kforner commented Apr 30, 2018

(empty) hashmap creation: ~ 80x slower

microbenchmark(new.env(), hashmap(numeric(0), numeric(0)))
# Unit: nanoseconds
#                             expr   min      lq      mean  median      uq    max neval cld
#                        new.env()   640   803.5   1245.52  1182.5  1310.5  14147   100  a 
#  hashmap(numeric(0), numeric(0)) 93833 95027.0 101540.09 95987.5 98018.5 258528   100   b

inserting one element: ~ 10x slower

microbenchmark(assign("toto", TRUE, envir = env), hm$insert("toto", TRUE))
# Unit: nanoseconds
#                               expr  min     lq    mean median     uq   max neval cld
#  assign("toto", TRUE, envir = env)  514  622.5  743.01  713.0  800.5  2406   100  a 
#            hm$insert("toto", TRUE) 7512 7765.0 8881.30 7860.5 8039.5 93803   100   b

I understand (from the benchmarks) that you are focusing on bulk operations, but still considering the title "The Faster Hash Map" I was quite disappointed.

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

No branches or pull requests

1 participant