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

tables misc #82

Open
timotheecour opened this issue Mar 31, 2020 · 5 comments
Open

tables misc #82

timotheecour opened this issue Mar 31, 2020 · 5 comments

Comments

@timotheecour
Copy link
Owner Author

timotheecour commented May 8, 2020

D20200428T185548 the PR (Unwind just the "pseudorandom probing" part of recent sets,tables changes by c-blake · Pull Request #13816 · nim-lang/Nim) that reverted my tables pseudorandom work causes a number of speed regressions eg:

  • regression caused by D20200428T185548
when defined case1: # D20200507T201947 gitissue
  # with nim js
  import hashes
  static:
    doAssert hash(123) != 0 # fails

Edited:
It works now.

@timotheecour
Copy link
Owner Author

  • regression D20200507T203625 caused by D20200428T185548

5X slower

(using -d:danger for timing)

import tables
import times
proc main=
  var
    map = initTable[int, int]()

  for i in 0..<10_000_000:
    map[i] = i
  for i in 0..<3:
    for j in 0..<10_000_000:
      map[j] = map[j] + 1
let t = cpuTime()
main()
let t2 = cpuTime() - t
echo t2
doAssert t2 < 1.0

@timotheecour
Copy link
Owner Author

@timotheecour
Copy link
Owner Author

@timotheecour
Copy link
Owner Author

performance impact of auto-initializing?

refs: nim-lang#11094 (comment)
nim-lang/RFCs#101 (comment)

For 64-element tables, the change seems to make the whole benchmark about 4% slower.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant