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

Use perfect hash for temperature lookup #694

Closed
wants to merge 0 commits into from

Conversation

ianopolousfast
Copy link
Contributor

Check List:

  • You have run ./mvnw verify and the project builds successfully
  • Tests pass (./test.sh <username> shows no differences between expected and actual outputs)
  • All formatting changes by the build are committed
  • Your launch script is named calculate_average_<username>.sh (make sure to match casing of your GH user name) and is executable
  • Output matches that of calculate_average_baseline.sh
  • For new entries, or after substantial changes: When implementing custom hash structures, please point to where you deal with hash collisions (line number)
  • Execution time: 11.4s on 4 core i7 (.6s faster)
  • Execution time of reference implementation: 288s

@gunnarmorling
Copy link
Owner

Coming in a bit slower than before:

Benchmark 1: timeout -v 300 ./calculate_average_ianopolousfast.sh 2>&1
  Time (mean ± σ):      4.781 s ±  0.061 s    [User: 33.966 s, System: 0.747 s]
  Range (min … max):    4.695 s …  4.847 s    5 runs

Summary
  ianopolousfast: trimmed mean 4.787922194599999, raw times 4.6949676626,4.742957694599999,4.8201604766,4.8006484126,4.8468138546

Leaderboard

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes     |
|---|-----------------|--------------------|-----|---------------|-----------|
|   | 00:04.787 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_ianopolousfast.java)| 21.0.1-open | [Dr Ian Preston](https://github.com/ianopolousfast) |  |

@ianopolousfast
Copy link
Contributor Author

That's puzzling. It was a big speed up locally on 4 and 12 core machines.

@gunnarmorling
Copy link
Owner

Just ran it again, same outcome (within the precision I can measure, it fluctuates by +- 1.5%).

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