Commit Graph

465 Commits

Author SHA1 Message Date
2f82e8788d moved rust implementation to /src/main/rust 2024-07-23 13:23:26 +02:00
Ruslan Kovtun
dfec2cdbe6 Fixes progress bar for create_measurements.py 2024-03-03 13:10:46 +01:00
Daniel Patrick
6125ba4dfa Explicit float in commented out code 2024-03-03 13:10:15 +01:00
Daniel Patrick
6daa93cca1 More accurate file size estimate 2024-03-03 13:10:15 +01:00
Eugene Huang
e1fb378acc
Add elh's Go solution (#435)
* add elh's Go solution

* update elh. fix a bad for loop and add some tuning env vars
2024-02-02 21:37:28 +01:00
Martin
f02279df8c
martin2038: first submission (#665)
* first double as int

* - hashcode

* JAVA_OPTS empty

* native

* native

* CalculateAverage_melgenek
https://questdb.io/blog/building-faster-hash-table-high-performance-sql-joins/#fastmap-internals

* mvn formatting

* jvm model

* 10k name

* 10k name

* round mean

* limit ChunkSize  smaller than Integer.MAX_VALUE

---------

Co-authored-by: martin.cong <martin.cong@zhulinkeji.com>
2024-02-02 21:04:30 +01:00
Smoofie
a78c1fc973
Submission for Smoofie (#701)
* Smoofie solution. Kinda slow but it was fun :)

* Format according to mvn build

* Fix semicolon detection, which cause invalid temperature parsing and subsequently segmentation faults due to counter addressing
2024-02-01 19:32:54 +01:00
Chris Bellew
8ab88e9f5c
SIMD parsing newlines, integer parsing, custom hashtable with SIMD lookup table for equality (#663)
* Add submission

* Added explanatory comment

* Added comment

* Rename shell script

* Commit formatting

* When last bytes don't fill a vector, take directly

* Add comment

* Deal with subset collisions
2024-02-01 16:59:05 +01:00
JurenIvan
1b23172afb
My first submission (#697)
* Common sense implementation

* fix filename

* formatting

* remove excess system.out.println

* fix hash collisions

* ajdust so taht segment size smaller than Integer.MAX_VALUE
2024-02-01 14:30:22 +01:00
yourwass
75bece5364
improved 2nd and final submission (#685) 2024-02-01 12:25:58 +01:00
Anita SV
101993f06d
CA_vaidhy final changes. (#708) 2024-02-01 12:15:23 +01:00
Diego Parra
bec0cef2d3
dpsoft: first submission (#572)
* dpsoft: first submission

* minor clean up

* map with linear probing

* clean up

* update prepare

* clean up

* remove string format

* add credits

* fix format

* use prepare.sh

* graal 21.0.2

* fix differences

* clean up

* underflow protection

* improve segments generation logic

* clean up

* remove unnecessary alignment in findsegment

* new try

* fix number of segments
2024-02-01 12:06:28 +01:00
Panagiotis Drakatos
2aed039f17
My Probably last attempt to optimize performance (#693)
* 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

* Fresh solution to optimize performance of the execution

* New Fresh solution with optimized performance with Custom Hashtable

* Increase maxperm size and xmx to avoid heap spaces error
2024-02-01 12:02:45 +01:00
gonix
1e7314d5fb
CalculateAverage_gonix update (#706)
Backported some of the optimizations from unsafe solution.

Co-authored-by: Giedrius D <d.giedrius@gmail.com>
2024-02-01 11:53:46 +01:00
tivrfoa
fdd539e1f9
Exit earlier from loop when a new Result is created (#668)
* Exit earlier from loop when a new Result is created

 *   3) Make a cache of long[] name to String, to avoid `ByteBuffer.allocate`
 * and creating new UTF-8 strings. I didn't profile, so it's just a guess
 * that this map will be a bit faster. Although it's outside the main loop, so
 * not a big difference ...;
 *   4) Exit earlier from loop if a new entry was created.

* revert: Remove cache to city name

* As I was not able to make it faster... make it slower

As I was not able to make it faster ... so I'll make it slower,
because my current solution should *not* stay at the top, as it added
basically nothing.
2024-02-01 11:49:47 +01:00
Sumit Chaudhary
e7c92094bd
EduardoSaverin (#689)
* EduardoSaverin

UserName : EduardoSaverin
Total Time : 15.408
CPU : 8 Core (Apple M1 Pro)
RAM : 16GB

* Update CalculateAverage_EduardoSaverin.java

Removed ConcurrentHashMap with Reentrant Lock + HashMap. Since multiple threads causing problems.
2024-02-01 11:41:13 +01:00
Li Lin
9a27939f87
Add linl33 v2 (#678) 2024-02-01 11:27:56 +01:00
Artsiom Korzun
da26f61137
handling 16 at once (#704) 2024-02-01 11:14:31 +01:00
Jaromir Hamala
9e2199a5d7
nobody should try this at home (#709) 2024-02-01 11:01:18 +01:00
Thomas Wuerthinger
241d42ca66
One last improvement for thomaswue (#702)
* Combine <8 and 8-16 cases into one case.

* Adopt mask-based approach for the <16 length city fast path (idea of Van Phu Do).

* Slightly improved code layout.

* Update perf number.
2024-02-01 10:57:05 +01:00
Guruprasad Sridharan
d1cdb8587c
1brc submission by godofwharf (#658)
* 1brc submission by godofwharf

* Fix prepare script

* Modify shebang

* Fix formatting

* Remove unused FastHashMap implementation
2024-01-31 22:22:39 +01:00
gonix
540ef2c863
CalculateAverage_gonixunsafe: an attempt in the unsafe category (#695)
Co-authored-by: Giedrius D <d.giedrius@gmail.com>
2024-01-31 22:17:08 +01:00
Jamal Mulla
e639e2a045
Second attempt with various improvements (#510)
* Initial chunked impl

* Bytes instead of chars

* Improved number parsing

* Custom hashmap

* Graal and some tuning

* Fix segmenting

* Fix casing

* Unsafe

* Inlining hash calc

* Improved loop

* Cleanup

* Speeding up equals

* Simplifying hash

* Replace concurrenthashmap with lock

* Small changes

* Script reorg

* Native

* Lots of inlining and improvements

* Add back length check

* Fixes

* Small changes

---------

Co-authored-by: Jamal Mulla <j.mulla@mwam.com>
2024-01-31 22:09:25 +01:00
Sudhir Tumati
b91c95a498
sudhirtumati implementation (#598) 2024-01-31 21:57:32 +01:00
Breejesh Rathod
33143cdbb8
breejesh Submission (#670)
* 1BRC breejesh

* Fix output

* Fix formatting

* Format and remove preview feature

* Optimize merge

* Revert "Optimize merge"

This reverts commit 28c9b4af29e1c90e992e8a1fd4f3258895782c2c.

---------

Co-authored-by: Breejesh Rathod <breejesh.rathod@m2pfintech.com>
2024-01-31 21:52:40 +01:00
Stephen Von Worley
a533019ad4
CalculateAverage_stephenvonworley submission (#677)
* first release

* change constants to names

---------

Co-authored-by: Stephen Von Worley <von@von.io>
2024-01-31 21:49:19 +01:00
Sebastian Lövdahl
a8823a1f93
slovdahl's submission (#691)
* slovdahl: First submission

* More JAVA_OPTS flags, 0.1s better locally
2024-01-31 21:37:50 +01:00
Aleksey Shipilëv
47046f327d
Shipilev: improve comments (#692) 2024-01-31 20:30:41 +01:00
Artsiom Korzun
e81326b83d
trying TuneInlinerExploration=1 (#662) 2024-01-31 20:18:13 +01:00
Cedric Boes
d496adb049
Adding solution for cb0s (#575)
* feat: add solution for cb0s

* Update prepare_cb0s.sh

* Update calculate_average_cb0s.sh

* Update prepare_cb0s.sh

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-31 20:13:40 +01:00
Van Phu DO
3c454d0222
final version for abeobk (#654)
* final version

* Correct stupid mistake

* min/max trick does not help that much, setting initial value does.

* cut the tail
2024-01-31 20:03:20 +01:00
Serkan ÖZAL
6a2e5058af
serkan-ozal's 7th submission: (#679)
- use smaller regions (increased region count) so there will be less idle time for the workers who completed their tasks
- get rid of some configuration related stuff during initialization which might save a few tens of milliseconds hopefully
- update temperature value parsing instruction order to get benefit of ILP better (hopefully)
2024-01-31 18:21:25 +01:00
Jaromir Hamala
9b9bb8ed3f
jerrinot - final(?) improvements (#690)
* decrease instruction level parallelism

it turns out doing 2 things was too much. perf annotate showed spilling.

* more trickery with latency hiding

* work-stealing, lookp tables, credits

* do not assume gender
2024-01-31 18:17:34 +01:00
Roman Stoffel
b529ef2a59
Gamlerhart Last Update: Disabling GC (#636)
* Disable The GC

Cuts off sometimes up to 1 seconds
of runtime on my machine.

* Remove Confusing Byte-Order Parameter

Bytes have no Byte-Order ;)

* Provide More Memory to Run the 10K set

* Fix Comparison Function
2024-01-31 18:13:08 +01:00
Peter Levart
3cc4fc85d8
update1: restructuring for better compilation (#661) 2024-01-31 18:07:56 +01:00
Yevhenii Melnyk
c5b7b19e57
melgenek: minor improvements (#655)
* melgenek: minor improvements

* More memory
2024-01-31 18:05:09 +01:00
Judekeyser
711aa2395a
Justin's implementation (#666)
* Justin's implementation

* Rename justin to Judekeyser

* Back to previous implementation of vectors

* Reading names as sequences of integers

* Fixing tests

* Scale down the number of NIO workers

---------

Co-authored-by: Justin Dekeyser <justin.dekeyser@Justins-MacBook-Pro.local>
2024-01-31 17:59:50 +01:00
zerninv
11a89d6cb8
Attempt to fix segfault CalculateAverage_zerninv.java (#635)
* attempt to fix segfault, graal native

* fix last bytes for last line handler

* fix typo

* one more attempt
2024-01-31 17:44:50 +01:00
John Ziamos
e2ee4cbc30
give in to the graal (#660) 2024-01-31 17:41:40 +01:00
Andrzej Nestoruk
5728ca9482
copy city byte array only when creating a new record (#653) 2024-01-31 17:26:22 +01:00
nicky
f55317973c
batched writing to disk (#659)
instead of writing result line by line, implemented random.choices for randomisation of multiple stations and writing large batche ot the disk, also instead of "round" just using :.1f which is probably quicker on a large scale, because it's not a mathematical function
2024-01-31 17:07:29 +01:00
Dr Ian Preston
0c5c22882b
Process two consecutive lines at a time (#651)
Use a better hash function

Don't return index from temperature parsing
extra JVM args

Co-authored-by: Ian Preston <ianopolous@protonmail.com>
2024-01-31 17:06:05 +01:00
Serkan ÖZAL
f6aa09926c
serkan-ozal's 6th submission: (#667)
- process multiple lines at a time to get the benefit of ILP (Instruction Level Parallelism) better
2024-01-31 09:56:11 +01:00
Quan Anh Mai
1a4ac0d249
Final submission (#669)
* more efficient max, min

* optimize pipeline

* apply parallel to both submissions

* fix bug
2024-01-31 09:47:48 +01:00
Anita SV
af2b5517c8
anitasv 3.8s vs 3m 19s : Improved using custom hashmap. (#672)
* Some optimizations while staying safe

* bug fix not caught on tests
2024-01-31 09:41:33 +01:00
Arman Sharif
974ddbae60
armandino: misc improvements (#673) 2024-01-31 09:39:08 +01:00
Thomas Wuerthinger
a5ce4ba771
Added comments to used flags, clean up code, final fine tuning. (#674) 2024-01-31 09:34:15 +01:00
Jaime Polidura
2a44f8d390
Added improvments on string copying, string comparation & calculation of next index in case of collision in custom map (#650)
* 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

* added improvemnts on string copying, calculation of next index of Map in case on collision & improved string comparing
2024-01-29 22:22:22 +01:00
Thomas Wuerthinger
036f9a01b1
Clean up, fine tuning, credit section for thomaswue (#646)
* Some clean up, fine tuning, removing non-supported options, added credit
section and additional comments.

* Put license header year back to 2023 to pass checks.

* Remove static linking (as it requires some more setup on the target
machine).
2024-01-29 22:19:23 +01:00
Serkan ÖZAL
5b9703283a
serkan-ozal's 5th submission: (#648)
- use region address directly over null base memory address to get rid of extra offset calculation
2024-01-29 22:11:27 +01:00
Paweł Adamski
d9d2f3f97f
Paweł Adamski - 1brc submission (#629)
* Paweł Adamski - 1BRC challenge

* Paweł Adamski - 1BRC challenge

* Make files executabe
2024-01-29 21:35:51 +01:00
Serkan ÖZAL
7d52a37600
serkan-ozal's 4th submission: (#645)
- split big regions into shared smaller tasks, so the workers complete their own tasks can pick up from the remaining instead of leaving its core idle
- reduce number of executed instructions in the hot path
2024-01-29 21:27:06 +01:00
tivrfoa
f4a0039a59
Try more chunks than threads, and of different sizes (#644)
/**
 * Solution based on thomaswue solution, commit:
 * commit d0a28599c2
 * Author: Thomas Wuerthinger
 * Date:   Sun Jan 21 20:13:48 2024 +0100
 *
 * The goal here was to try to improve the runtime of his 10k
 * solution of: 00:04.516
 *
 * With Thomas latest changes, his time is probably much better
 * already, and maybe even 1st place for the 10k too.
 * See: https://github.com/gunnarmorling/1brc/pull/606
 *
 * But as I was already coding something, I'll submit just to
 * see if it will be faster than his *previous* 10k time of
 * 00:04.516
 *
 * Changes:
 *   It's a similar idea of my previous solution, that if you split
 * the chunks evenly, some threads might finish much faster and
 * stay idle, so:
 *   1) Create more chunks than threads, so the ones that finish first
 * can do something;
 *   2) Decrease chunk sizes as we get closer to the end of the file.
 */
2024-01-29 21:24:04 +01:00
Van Phu DO
8e407ca79d
apply loop unroll trick (#643)
* apply loop unroll trick

* less assign op, a bit faster
2024-01-29 21:21:04 +01:00
Panagiotis Drakatos
31a6740ef1
New Fresh Solution to Optimize Execution time (#641)
* 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

* Fresh solution to optimize performance of the execution
2024-01-29 21:16:40 +01:00
giovannicuccu
1281e77be4
new version by Giovanni Cuccu (#640)
* 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 )

* new version that should perform way better than the previous one

* removed prepare script for giovannicuccu

* removed some comments

---------

Co-authored-by: Giovanni Cuccu <gcuccu@imolainformatica.it>
2024-01-29 21:12:05 +01:00
Yavuz Tas
a82cf2ceb7
improve speed, thanks to the following improvements: (#550)
* improve speed, thanks to the following improvements:
- loop unrolling and eleminating extra calculations
- eleminating instance level variable access
- quicker equals check, checking long by long chunks instead of bytes
- update GraalVM version to the latest

* faster equals check

* fix equals bug in 10K, more optimizations on equals and calculate hash parts

* New solution optimized for Linux/AMD hardware

* Optimize solution, try to fix 10K bug on native

* Optimize solution, move records to a local field

* test timing

* revert back accidentally pushed code

---------

Co-authored-by: Yavuz Tas <yavuz.tas@ing.com>
2024-01-29 21:02:20 +01:00
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
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
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
Aleksey Shipilëv
baed56bcdb
Version 4 (#183) 2024-01-28 18:36:22 +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
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
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
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
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
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
Roman Musin
f9c58414da
Next version (#596)
* cleanup prepare script

* native image options

* fix quardaric probing (no change to perf)

* mask to get the last chunk of the name

* extract hash functions

* tweak the probing loop (-100ms)

* fiddle with native image options

* Reorder conditions in hope it makes branch predictor happier

* extracted constant
2024-01-27 15:17:55 +01:00
Van Phu DO
c228633b57
improve hard disk access locality, another 8% (#591)
* improve hard disk access locality, another 8%

* add some comments & credit

* fixed format
2024-01-27 14:54:43 +01:00
Hieu Dao Quang
5092eb44d1
First attempt with Java-managed concurrency (#590)
Co-authored-by: Quang Hieu Dao <hieu_dq@flinters.vn>
2024-01-27 14:49:59 +01:00
rcasteltrione
769884426b
Initial submission (#588)
* Initial submission

* fixed not executable scripts
2024-01-27 14:43:51 +01:00
Jason Nochlin
457a36be63
Fix hundredwatt's entry on 10k dataset (#558)
* Improve hash function

* remove limit on number of cores

* fix calculation of boundaries between chunks

* fix IOOBE

---------

Co-authored-by: Jason Nochlin <hundredwatt@users.noreply.github.com>
2024-01-26 18:22:35 +01:00
gonix
27b867d10d
CalculateAverage_gonix update (#579)
Minor updates here and there, shaves off ~5% of execution time on my machine.
2024-01-25 23:37:20 +01:00
Alberto Venturini
cb7423d386
Contribution by albertoventurini (#578)
* Contribution by albertoventurini

* Shave off a couple of hundreds of milliseconds, by making an assumption on temperature readings

* Parse reading without loop, inspired by other solutions

* Use all cores

* Small improvements, only allocate 247 positions instead of 256

---------

Co-authored-by: Alberto Venturini <alberto.venturini@accso.de>
2024-01-25 23:17:39 +01:00
Roman Stoffel
94e29982f9
Updates for gamlerhart: Simpler & Faster (#580)
* Update with Rounding Bugfix

* Simplification of Merging Results

* More Plain Java Code for Value Storage

* Improve Performance by Stupid Hash

Drop around 3 seconds on my machine by
simplifying the hash to be ridicules stupid,
but faster.

* Fix outdated comment
2024-01-25 23:12:10 +01:00
Dmitry Bufistov
b20e7365e7
Second submission to keep a bit of dignity (#581)
* Dmitry challenge

* Dmitry submit 2.

Use MemorySegment of FileChannle and Unsafe
to read bytes from disk. 4 seconds speedup in local test
from 20s to 16s.
2024-01-25 23:09:22 +01:00
Antonio Muñoz
65d2c1b0c9
tonivade improved solution (#582)
* tonivade improved not using HashMap

* use java 21.0.2

* same hash same station

* remove unused parameter in sameSation

* use length too

* refactor parallelization

* use parallel GC

* refactor

* refactor
2024-01-25 23:07:20 +01:00
Dr Ian Preston
0bd1675571
Down to 14s locally (#583)
Use flat array for stats.
Use simd for line termination

Co-authored-by: Ian Preston <ianopolous@protonmail.com>
2024-01-25 23:03:05 +01:00
Arman Sharif
d5cedd6a35
armandino: minimise hash collisions + other improvements (#585) 2024-01-25 22:59:18 +01:00