Commit Graph

566 Commits

Author SHA1 Message Date
Marko Topolnik
886f0cdb4d
mtopolnik submission 3 (#637)
* calculate_average_mtopolnik

* short hash (just first 8 bytes of name)

* Remove unneeded checks

* Remove archiving classes

* 2x larger hashtable

* Add "set" to setters

* Simplify parsing temperature, remove newline search

* Reduce the size of the name slot

* Store name length and use to detect collision

* Reduce memory loads in parseTemperature

* Use short for min/max

* Extract constant for semicolon

* Fix script header

* Explicit bash shell in shebang

* Inline usage of broadcast semicolon

* Try vectorization

* Remove vectorization

* Go Unsafe

* Use SWAR temperature parsing by merykitty

* Inline some things

* Remove commented-out MemorySegment usage

* Inline namesMem.asSlice() invocation

* Try out JVM JIT flags

* Implement strcmp

* Remove unused instance variables

* Optimize hashing

* Put station name into hashtable

* Reorder method

* Remove usage of MemorySegment.getUtf8String

Replace with UNSAFE.copyMemory() and new String()

* Fix hashing bug

* Remove outdated comments

* Fix informative constants

* Use broadcastByte() more

* Improve method naming

* More hashing

* Revert more hashing

* Add commented-out code to hash 16 bytes

* Slight cleanup

* Align hashtable at cacheline boundary

* Add Graal Native image

* Revert Graal Native image

This reverts commit d916a42326d89bd1a841bbbecfae185adb8679d7.

* Simplify shell script (no SDK selection)

* Move a constant, zero out hashtable on start

* Better name comparison

* Add prepare_mtopolnik.sh

* Cleaner idiom in name comparison

* AND instead of MOD for hashtable indexing

* Improve word masking code

* Fix formatting

* Reduce memory loads

* Remove endianness checks

* Avoid hash == 0 problem

* Fix subtle bug

* MergeSort of parellel results

* Touch up perf

* Touch up perf

* Remove -Xmx256m

* Extract result printing method

* Print allocation details on OOME

* Single mmap

* Use global allocation arena

* Add commented-out Xmx64m XXMaxDirectMemorySize=1g

* withinSafeZone

* Update cursor earlier

* Better assert

* Fix bug in addrOfSemicolonSafe

* Move declaration lower

* Simplify code

* Add rounding error test case

* Fix DANGER_ZONE_LEN

* Deoptimize parseTemperatureSimple()

* Inline parseTemperatureAndAdvanceCursor()

* Skip masking until the last load

* Conditionally fetch name words

* Cleanup

* Use native image

* Use supbrocess

* Simpler code

* Cleanup

* Avoid extra condition on hot path
2024-01-29 20:51:52 +01:00
Artsiom Korzun
5ba094c8fd
loop similar to thomas (#634) 2024-01-29 20:36:25 +01:00
Gunnar Morling
1eaf8791c1
Adding some articles 2024-01-29 10:00:39 +01:00
Gunnar Morling
eeed048466 Leaderboard update 2024-01-29 08:55:20 +01:00
Gunnar Morling
2b55f0dd6b Leaderboard update 2024-01-28 23:43:07 +01:00
Jaime Polidura
3ed80c4b5f
Thank you for the challange!! (#599)
* added code

* Fixed pointers bugs

* removed my own benchmark

* added comment on how I handle hash collisions

* executed mwvn clean verify

* made scripts executable & fixed rounding issues

* Fixed way of dealing with hash collisions

* changed method name sameNameBytes to isSameNameBytes

* changes script from sh to bash

* fixed chunking bug

* Fixed bug in chunking when file size is too small

* added Runtime.getRuntime().availableProcessors
2024-01-28 23:31:03 +01:00
giovannicuccu
be5b3318b1
Solution without unsafe using vector API (#602)
* Solution without unsafe

* Solution without unsafe

* Solution without unsafe, remove the usage of bytebuffer, passes the create_measurements3 test

* bug fix for 10k test, update also the CreateMeasurements3.java to use '\n' as newline instead of the os value (if it runs on windows it uses crlf and "breaks" the file format )

---------

Co-authored-by: Giovanni Cuccu <gcuccu@imolainformatica.it>
2024-01-28 23:24:47 +01:00
Serkan ÖZAL
46d375e621
serkan-ozal's 3rd submission with some minor improvements: (#615)
- faster merge by ignoring empty entries in the map
- enable CDS for faster startup (added `prepare_serkan-ozal.sh` to generate CDS archive in advance)
- some tweaks with JVM options
- optimized result printing
2024-01-28 23:02:01 +01:00
Andrzej Nestoruk
ff35a4628b
anestoruk second attempt (#625)
* initial implementation

* few improvements and a cleanup (down to ~12s)

* use array instead of hashmap for collecting partial results
2024-01-28 22:59:04 +01:00
Artsiom Korzun
9282fb7b0a
processing three at once (#626) 2024-01-28 22:56:33 +01:00
Gunnar Morling
99a754d0cd
Update pull_request_template.md 2024-01-28 22:52:44 +01:00
Gunnar Morling
87f3b71701
Update pull_request_template.md 2024-01-28 22:52:29 +01:00
Gunnar Morling
99367dbc50
Update pull_request_template.md 2024-01-28 22:52:12 +01:00
Aleksey Shipilëv
82197d4482
shipilev: Amendments to version 4 (#627)
* Amendments

* One more locality touchup: no need to carry the entire name array
2024-01-28 22:49:34 +01:00
Jaromir Hamala
9da1660ba5
jerrinot - running out of ideas (#631)
* another shameless copycat from thomas: less safepoints

* I have no idea what I am doing
2024-01-28 22:43:53 +01:00
Dr Ian Preston
3a790c99b9
Reduce preferred vector size (#622)
Co-authored-by: Ian Preston <ianopolous@protonmail.com>
2024-01-28 22:39:17 +01:00
Gunnar Morling
bb9bc68e41 Fixing link 2024-01-28 21:55:52 +01:00
Gunnar Morling
f98304e4a7 Fixing leaderboard entries with difference between user name and class name 2024-01-28 20:43:16 +01:00
Gunnar Morling
2bb74fe071 Leaderboard update 2024-01-28 18:37:11 +01:00
Aleksey Shipilëv
baed56bcdb
Version 4 (#183) 2024-01-28 18:36:22 +01:00
Gunnar Morling
5dffd8e9b3 Leaderboard update 2024-01-28 18:33:07 +01:00
Mahadev K
f598d74594
Mahadev virtual thread 1brc (#611)
* Read file with multiple virtual threads and process chunks of file data in parallel.

* Updated logic to bucket every chunk of aggs into a vector and merge them into a TreeMap for printing.

* Virtual Thread / File Channels Impl.

* Renamed files with GHUsername.

* Added statement to get vals before updating.

* Added executable permission to the files.
2024-01-28 18:26:44 +01:00
Dimitris Karampinas
f5bddafaf7
Dkarampi solution (#614)
* Simple multi-threaded version

* Format code

* Formatted code

* More formatting
2024-01-28 18:12:54 +01:00
Van Phu DO
a33ed2181b
Use native type, remove lots of type conversions (#618)
* less type conversion, less string cast

* adjust some comments

* fixed format issue
2024-01-28 18:08:42 +01:00
Aleksei
d5854d65e6
Bytesfellow initial submittion (#619)
* Latest snapshot (#1)

preparing initial version

* Improved performance to 20seconds  (-9seconds from the previous version) (#2)

improved performance a bit

* Improved performance to 14 seconds (-6 seconds) (#3)

improved performance to 14 seconds

* sync branches (#4)

* initial commit

* some refactoring of methods

* some fixes for partitioning

* some fixes for partitioning

* fixed hacky getcode for utf8 bytes

* simplified getcode for partitioning

* temp solution with syncing

* temp solution with syncing

* new stream processing

* new stream processing

* some improvements

* cleaned stuff

* run configuration

* round buffer for the stream to pages

* not using compute since it's slower than straightforward get/put. using own byte array equals.

* using parallel gc

* avoid copying bytes when creating a station object

* formatting

* Copy less arrays. Improved performance to 12.7 seconds (-2 seconds) (#5)

* initial commit

* some refactoring of methods

* some fixes for partitioning

* some fixes for partitioning

* fixed hacky getcode for utf8 bytes

* simplified getcode for partitioning

* temp solution with syncing

* temp solution with syncing

* new stream processing

* new stream processing

* some improvements

* cleaned stuff

* run configuration

* round buffer for the stream to pages

* not using compute since it's slower than straightforward get/put. using own byte array equals.

* using parallel gc

* avoid copying bytes when creating a station object

* formatting

* some tuning to increase performance

* some tuning to increase performance

* avoid copying data; fast hashCode with slightly more collisions

* avoid copying data; fast hashCode with slightly more collisions

* cleanup (#6)

* tidy up
2024-01-28 18:06:18 +01:00
Thomas Wuerthinger
7e525c5992
Some fine tuning for thomaswue (#606)
* Some fine tuning.

* Process 2MB segments to make all threads finish at the same time.
Process with 3 scanners in parallel in the same thread.
2024-01-28 17:59:57 +01:00
Gunnar Morling
c8dd691a27 Leaderboard update 2024-01-28 17:59:46 +01:00
Gunnar Morling
9531407119 Leaderboard update 2024-01-28 17:13:21 +01:00
Andrzej Nestoruk
b3d6659d68
anestoruk submission (#617)
* initial implementation

* few improvements and a cleanup (down to ~12s)
2024-01-28 17:12:32 +01:00
John Ziamos
97334e8621
use long for string equals (#613)
use more generic hashcode
2024-01-28 17:03:42 +01:00
Jonathan Wright
8ef22ab1bd
Initial submission for jonathan_aotearoa. (#586)
* Initial submission for jonathan_aotearoa

* Fixing typos

* Adding hyphens to prepare and calculate shell scripts so that they're aligned with my GitHub username.

* Making chunk processing more robust in attempt to fix the cause of the build error.

* Fixing typo.

* Fixed the handling of files less than 8 bytes in length.

* Additional assertion, comment improvements.

* Refactoring to improve testability. Additional assertion and comments.

* Updating collision checking to include checking if the station name is equal.

* Minor refactoring to make param ordering consistent.

* Adding a custom toString method for the results map.

* Fixing collision checking bug

* Fixing rounding bug.

* Fixing collision bug.

---------

Co-authored-by: jonathan <jonathan@example.com>
2024-01-28 16:30:22 +01:00
Gunnar Morling
243f34f38b Adding 10K eval script 2024-01-28 16:25:04 +01:00
Gunnar Morling
5f467c668a Leaderboard update 2024-01-28 11:56:44 +01:00
Serkan ÖZAL
6bd2a21686
serkan-ozal's 2nd submission with some minor improvements: (#612)
- use shared memory arena and region between worker threads
- reduce number of instructions slightly while processing file region
2024-01-28 11:56:30 +01:00
Gunnar Morling
5bb6c5f3ef Leaderboard update 2024-01-28 11:35:19 +01:00
Jaromir Hamala
d9ab36a241
jerrinot's improvement (#607)
* some random changes with minimal, if any, effect

* use munmap() trick
credit: thomaswue

* some smaller tweaks

* use native image
2024-01-28 11:34:28 +01:00
PanosDR
a6cd83fc98
CalculateAverage_pdrakatos (#515)
* CalculateAverage_pdrakatos

* Rename to be valid with rules

* CalculateAverage_pdrakatos

* Rename to be valid with rules

* Changes on scripts execution

* Fixing bugs causing scripts not to be executed

* Changes on prepare make it compatible

* Fixing passing all tests

* Increase direct memory allocation buffer

* Fixing memory problem causes heap space exception
2024-01-28 10:25:53 +01:00
Alberto Venturini
936fc1da54
Second version by albertoventurini (#609)
* Contribution by albertoventurini

* Use byte arrays of size 2^20

---------

Co-authored-by: Alberto Venturini <alberto.venturini@accso.de>
2024-01-28 10:02:42 +01:00
Serkan ÖZAL
3e208be741
serkan-ozal: Initial impl (#553)
* Initial impl

* Fix bad file descriptor error in the `calculate_average_serkan-ozal.sh`

* Disable Epsilon GC and rely on default GC. Because apparently, JIT and Epsilon GC don't play well together in the eval machine for short lived Vector API's `ByteVector` objects

* Take care of byte order before processing key length with bit shift operators

* Fix key equality check for long keys
2024-01-28 09:53:09 +01:00
Gunnar Morling
9dde50872f Leaderboard update;
- Had used wrong link for Subrahmanyam non-idiomatic at first
- Adding 10K key set eval using Subrahmanyam non-idiomatic
2024-01-28 09:46:25 +01:00
Gunnar Morling
fddf5326cf Leaderboard update 2024-01-28 09:29:15 +01:00
Dr Ian Preston
8279aa7560
Simplify dedupeStation() (#589)
13.8s locally now.

Co-authored-by: Ian Preston <ianopolous@protonmail.com>
2024-01-27 19:43:41 +01:00
tivrfoa
d9604d9258
Use LinkedBlockingQueue to process results - based on thomaswue (#603)
/**
 * Solution based on thomaswue solution, commit:
 * commit d0a28599c2
 * Author: Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
 * Date:   Sun Jan 21 20:13:48 2024 +0100
 *
 * Changes:
 *   1) Use LinkedBlockingQueue to store partial results, that
 *   will then be merged into the final map later.
 *   As different chunks finish at different times, this allows
 *   to process them as they finish, instead of joining the
 *   threads sequentially.
 *     This change seems more useful for the 10k dataset, as the
 *   runtime difference of each chunk is greater.
 *   2) Use only 4 threads if the file is >= 14GB.
 *   This showed much better results on my local test, but I only
 *   run with 200 million rows (because of limited RAM), and I have
 *   no idea how it will perform on the 1brc HW.
 */
2024-01-27 19:41:00 +01:00
Yevhenii Melnyk
a304f80710
(new submission) melgenek: ~top 15 on 10k. Buffered IO, VarHandles, vectors, custom hashtable (#600)
* melgenek: ~top 15 on 10k. Buffered IO, VarHandles, vectors, custom hashtable

* Calculate the required heap size dynamically
2024-01-27 19:37:19 +01:00
Jairo Graterón
eea9c33858
Fix hash code collisions (#605)
* fix test rounding, pass 10K station names

* improved integer conversion, delayed string creation.

* new algorithm hash, use ConcurrentHashMap

* fix rounding test

* added the length of the string in the hash initialization.

* fix hash code collisions
2024-01-27 19:32:15 +01:00
Gunnar Morling
6b5b68c772 Leaderboard update 2024-01-27 18:20:13 +01:00
Gunnar Morling
f1209f2ba8 Leaderboard update 2024-01-27 16:10:47 +01:00
Manish Garg
5c47ce1cbd
Reading 1B row file using Java NIO lib. (#601) 2024-01-27 15:52:11 +01:00
Roy van Rijn
489ec9e3b1
Larger heap, small tweaks (#593)
More small tweaks, perf from 775~ to 738~
2024-01-27 15:24:06 +01:00
Florin Blanaru
84f6331b83
1BRC gigiblender (#595)
* Dirty implementation gigiblender

* Final impl gigiblender
2024-01-27 15:20:02 +01:00