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

1brc submission by godofwharf #658

Merged
merged 5 commits into from
Jan 31, 2024
Merged

Conversation

godofwharf
Copy link
Contributor

@godofwharf godofwharf commented Jan 30, 2024

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 environment: 8 vcores AMD EPYC 7000 (Rome) / 16 GiB RAM / SMT disabled
  • Execution time: 7.9 s
  • Execution time of reference implementation: 3m 11s

@godofwharf
Copy link
Contributor Author

@gunnarmorling Please review the same. My implementation doesn't use Unsafe and doesn't use Graal VM. It goes about processing the file in the following manner

  • Maps the input file into memory
  • Divides the input file into multiple splits and multiple pages
  • Processes the multiple splits in parallel using a custom thread pool one page after another
  • Uses Java's Vector API for identifying positions of new-line characters within each page
  • Uses thread local state maps to perform local aggregation within each split
  • Uses a ConcurrentHashMap to create a global aggregate map
  • Sorts the station names by importing map entries into a tree map

@gunnarmorling
Copy link
Owner

00:11.363.

@gunnarmorling gunnarmorling merged commit d1cdb85 into gunnarmorling:main Jan 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants