Commit Graph

344 Commits

Author SHA1 Message Date
Elliot Barlas
df891354d3
Inline and optimize value parsing code for each of the four semicolon position processing branches. This provides a small but noticeable speed-up. It also expands and obfuscates the code, unfortunately. (#563) 2024-01-23 16:31:04 +01:00
Li Lin
d2639b7ce1
Add linl33's implementation (#503)
* Add linl33's implementation

* Update evaluate.sh

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-21 21:14:05 +01:00
Artsiom Korzun
ac4805ee45
subprocess spawner (#542) 2024-01-21 20:23:48 +01:00
Roy van Rijn
d8b071c878
Reverting ByteBuffer idea, using Thomas's trick instead. (#538) 2024-01-21 20:15:07 +01:00
Thomas Wuerthinger
d0a28599c2
Tuning and subprocess spawn for thomaswue (#533)
* Some clean up, small-scale tuning, and reduce complexity when handling longer names.

* Do actual work in worker subprocess. Main process returns immediately
and OS clean up of the mmap continues in the subprocess.

* Update minor Graal version after CPU release.

* Turn GC back to epsilon GC (although it does not seem to make a
difference).

* Minor tuning for another +1%.
2024-01-21 20:13:48 +01:00
Artsiom Korzun
6b95ac6113
optimize branches (#534) 2024-01-21 19:54:43 +01:00
Elliot Barlas
47269cf30b
Adjust rolling hash function to operate at int-scale rather than byte-scale. Ensure 8-byte alignment in key buffer for faster comparisons. (#523) 2024-01-21 19:38:32 +01:00
Roman Musin
7bfc7eaec6
Reduce allocations and heap size (#525)
* Reduce allocations

* Shrink the heap size

* Calculate hash when reading name  (50-100ms difference)

* no need to reverse bytes

* bump heap size
2024-01-21 18:01:23 +01:00
Van Phu DO
410425c833
reorganize code, little bit faster (#509) 2024-01-21 13:25:18 +01:00
kumarsaurav123
8ba67cbc6d
Use Array to store results instead of grouping by and custom class (#522) 2024-01-21 12:50:36 +01:00
adri
0a7726cc64
Improving first iteration by avoiding string creation as much as possible (#516)
- It avoids creating unnecessary Strings objects and handles with the station names with its djb2 hashes instead
- Initializes hashmaps with capacity and load factor
- Adds -XX:+AlwaysPreTouch
2024-01-20 21:27:34 +01:00
giovannicuccu
2c1264def9
Solution without unsafe (#507)
Co-authored-by: Giovanni Cuccu <gcuccu@imolainformatica.it>
2024-01-20 21:01:43 +01:00
Shivam Agarwal
f06de5faab
Add 0xshivamagarwal Implementation (#508)
* 0xshivamagarwal implementation

* .

---------

Co-authored-by: Shivam Agarwal <>
2024-01-20 20:54:04 +01:00
karthikeyan97
f49a92019e
using unsafe alone (#512)
* final comit

changing using mappedbytebuffer

changes before using unsafe address

using unsafe

* using graalvm,correct unsafe mem implementation

---------

Co-authored-by: Karthikeyans <karthikeyan.sn@zohocorp.com>
2024-01-20 20:49:54 +01:00
Yann Moisan
ac26c8b644
Improved version based on rafaelmerino (#511)
* files created by create_fork.sh

* use indexOf

* improved implementation based on rafaelmerino

---------

Co-authored-by: Yann Moisan <yann@zen.ly>
2024-01-20 20:33:14 +01:00
Roman Musin
9100ed6316
Epsilon GC + a number of other small tweaks (#513)
* Version 3

* Use SWAR algorithm from netty for finding a symbol in a string

* Faster equals - store the remainder in a long field (- 0.5s)

* optimise parsing numbers - prep

* Keep tweaking parsing logic

* Rewrote number parsing

may be a tiby bit faster it at all

* Epsilon GC
2024-01-20 20:30:25 +01:00
Dr Ian Preston
062f2bbecf
Introducing the vector api. 1s faster on 4 core i7 (#506)
Co-authored-by: Ian Preston <ianopolous@protonmail.com>
2024-01-20 20:09:40 +01:00
Jaromir Hamala
114ba76d20
jerrinot's improvement (#514)
* refactoring

* segregated heap for names

also a different hashing function. turns out hashing just first word is good enough
2024-01-20 20:06:31 +01:00
Yonatan Graber
e1a0b79259
yonatang solution: a jdk8 friendly, no unsafe code, epsilon-gc friendly solution (#499)
* 1bc challenge, but one that will run using jdk 8 without unsafe and still do reasonably well.

* Better hashtable

* the fastest GC is no GC

* cleanups

* increased hash size

* removed Playground.java

* collision-handling allocation free hashmap

* formatting
2024-01-20 15:02:55 +01:00
Xylitol
8353a1cb3d
Processing byte array backwards (#504) 2024-01-20 14:04:19 +01:00
Elliot Barlas
eaf87689f5
Use Arena MemorySegments rather than ByteBuffers. (#505) 2024-01-20 13:56:27 +01:00
Roy van Rijn
7c983f3d66
Added dedicated reader (#493)
Started running perf, perhaps this helps. No idea how to use it yet
2024-01-19 22:15:49 +01:00
Juan Parera
f409fe0815
Change data storage improving memory locality (#496) 2024-01-19 22:06:48 +01:00
Van Phu DO
e67920f4af
low collision + fast mixer, more optimization, less if because if is slow (#474) 2024-01-19 22:03:51 +01:00
Artsiom Korzun
586def3620
plain old io (#492)
plain old io
2024-01-19 21:52:55 +01:00
Vemana
6e3893c6a6
Reduce variance by (1) Using common chunks at the end (2) Busy looping (#486)
on automatic closing of ByteBuffers.. previously, a straggler could hold
up closing the ByteBuffers.

Also
- Improve Tracing code
- Parametrize additional options to aid in tuning

Our previous PR was surprising; parallelizing munmap() call did not
yield anywhere near the performance gain I expected. Local machine had
10% gain while testing machine only showed 2% gain. I am still not clear
why it happened and the two best theories I have are
1) Variance due to stragglers (that this change addresses)
2) munmap() is either too fast or too slow relative to the other
   instructions compared to our local machine. I don't know which. We'll
   have to use adaptive tuning, but that's in a different change.
2024-01-19 21:47:55 +01:00
Eve
144a6af164
netrunnereve: more optimizations (#485) 2024-01-19 21:44:22 +01:00
Jin Cong Ho
ce8fe41bd4
Submission #3: jincongho (#482) 2024-01-19 21:40:05 +01:00
kumarsaurav123
f6bcaae4b9
kumarsaurav123 # Attempt 3 (#470)
* Use Memory Segment

* Reduce Number of threads
2024-01-19 21:35:25 +01:00
Antonio Goncalves
836f0805ad
GitHub Copilot Chat with the help of agoncal (#460)
* v1 - Initial prompt

* Introduce Records

* v1 - Initial prompt

* v2 - Introduce Records

* v3 - Improves code

* v4 - Improves JVM parameter

* GitHub Copilot Chat with the help of agoncal

* Format

* Pass measurements-rounding

* Added prepare script
2024-01-19 21:26:12 +01:00
Roman Musin
ec27a47ce1
Version 4 - roman-r-m (#484)
* Version 3

* trying to optimize memory access (-0.2s)

- use smaller segments confined to thread
- unload in parallel

* Only call MemorySegment.address() once (~200ms)
2024-01-19 17:20:57 +01:00
Dr Ian Preston
fefe326a14
3s (16%) faster, still no unsafe (#478)
* use Arena and MemorySegment to map entire file at once
* reduced branches and instructions
2024-01-19 17:14:45 +01:00
Jairo Graterón
9b28dd2aec
fix test rounding, pass 10K station names (#471) 2024-01-19 17:12:05 +01:00
zerninv
d0bdd335bd
Last attempt CalculateAverage_zerninv (#480)
* use bits magic

* apply style
2024-01-19 17:07:30 +01:00
Juan Parera
4e445a4f56
jparera's initial implementation (#433)
* jparera's initial implementation

* Fixes bugs and improves performance for measurements3.txt

* Allows measurements.txt ending without a LF
2024-01-17 21:52:33 +01:00
John Ziamos
4d7d9fb34e
extract cursor interface (#458)
'pull' mery kitty number parsing code

try out tonne of flags (found via trial and error on my system)
2024-01-17 21:41:32 +01:00
Vemana
199d6415bb
10% improvement from parallelizing munmap(); jumps to around 12th from 16th based on local testing; no Unsafe; no bitwise tricks yet (#465)
* Squashing a bunch of commits together.

Commit#2; Uplift of 7% using native byteorder from ByteBuffer.
Commit#1: Minor changes to formatting.

* Commit #4: Parallelize munmap() and reduce completion time further by
10%. As the jvm exits with exit(0) syscall, the kernel reclaims the
memory mappings via munmap() call. Prior to this change. all the unmap()
calls were happening right at the end as the JVM exited. This led to
serial execution of about 350ms out of 2500 ms right at the end after
each shard completed its work. We can parallelize it by exposing the
Cleaner from MappedByteBuffer and then ensure that it is truly parallel
execution of munmap() by using a non-blocking lock (SeqLock). The
optimal strategy for when each thread must call unmap() is an interesting math problem with an exact solution and this code roughly reflects it.

Commit #3: Tried out reading long at a time from bytebuffer and
checking for presence of ';'.. it was slower compared to just reading int().
Removed the code for reading longs; just retaining the
hasSemicolonByte(..) check code

Commit #2: Introduce processLineSlow() and processRangeSlow() for the
tial part.

Commit #1: Create a separate tail piece of work for the last few lines to be
processed separately from the main loop. This allows the main loop to
read past its allocated range (by a 'long' if we reserve atleast 8 bytes
for the tail piece of work.)
2024-01-17 21:30:31 +01:00
Matteo Vaccari
aee71b961d
My own solution -- memory mapping the files, running in parallel threads, using a state machine to parse the file (#466)
* Golang implementation

* Speed up by avoiding copying the lines

* Memory mapping

* Add script for testing

* Now passing most of the tests

* Refactor to composed method

* Now using integer math throughout

* Now using a state machine for parsing!

* Refactoring state names

* Enabling profiling

* Running in parallel!

* Fully parallel!

* Refactor

* Improve type safety of methods

* The rounding problem is due to difference between Javas and Gos printf implementation

* Converting my solution to Java

* Merging results

* Splitting the file in several buffers

* Made it parallel!

* Removed test file

* Removed go implementation

* Removed unused files

* Add header to .sh file

---------

Co-authored-by: Matteo Vaccari <mvaccari@thoughtworks.com>
2024-01-17 21:26:19 +01:00
MahmoudFawzyKhalil
08541525cd
MahmoudFawzyKhalil's implementation (#438)
* Initial commit trying out multiple things

* Clean up code

* Fix rounding error to fix failing test
2024-01-17 21:15:34 +01:00
gonix
27b9232b7d
CalculateAverage_gonix update (#461)
Co-authored-by: Giedrius D <d.giedrius@gmail.com>
2024-01-17 18:48:05 +01:00
Dr Ian Preston
e549efa3af
A fast implementation without unsafe (#462) 2024-01-17 18:44:02 +01:00
zerninv
765583e7d8
improve equality check performance, use graal jvm (#454) 2024-01-17 18:35:22 +01:00
Jaromir Hamala
927880b97e
edge-case in hashing fixed (#459)
also a bunch of smaller improvements
2024-01-17 18:28:03 +01:00
Roman Musin
77872e197d
Version 3 (#455) 2024-01-17 18:07:56 +01:00
gonix
7f5f808176
CalculateAverage_gonix initial attempt (#413) 2024-01-16 22:49:39 +01:00
karthikeyan97
455b85c5af
karthikeyan97 implementation (#417)
Co-authored-by: Karthikeyans <karthikeyan.sn@zohocorp.com>
2024-01-16 22:46:11 +01:00
Peter Levart
ffb09bf4bf
plevart: Look Mom No Unsafe! (#452) 2024-01-16 22:34:40 +01:00
Gunnar Morling
7ed5e1b0d4 Leaderboard, formatting 2024-01-16 22:31:50 +01:00
Van Phu DO
1804fc5b5f
Native build, less memory acess, improved hash mixing (#449) 2024-01-16 22:31:00 +01:00
adri
576291611d
Memory mapped buffers, ints instead of floats and epsilon GC (#451)
* Modify baseline version to improve performance

- Consume and process stream in parallel with memory map buffers, parsing it directly
- Use int instead of float/double to store values
- Use Epsilon GC and graal

* Update src/main/java/dev/morling/onebrc/CalculateAverage_adriacabeza.java

* Update calculate_average_adriacabeza.sh

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-16 22:23:35 +01:00
Anthony Goubard
e4b717e1a4
Read file in multiple threads and String to Text (#427)
* - Read file in multiple threads if available: 17" -> 15" locally
- Changed String to BytesText with cache: 12" locally

* - Fixed bug
- BytesText to Text
- More checks when reading the file

* - Combining measurements should be thread safe
- More readability changes
2024-01-16 22:10:38 +01:00
Arman Sharif
7bd2df7c59
armandino: second attempt (#445) 2024-01-16 22:04:37 +01:00
Keshavram Kuduwa
b1e6a120a4
Optimised code to iterate over non-null measurements (#444)
Co-authored-by: Keshavram Kuduwa <keshavram.kuduwa@apptware.com>
2024-01-16 22:02:26 +01:00
Artsiom Korzun
c080143ca8
fix masking (#442)
fix masking

fix masking
2024-01-16 21:54:42 +01:00
Artsiom Korzun
073d3aecdf
native version (#434) 2024-01-15 21:07:53 +01:00
Farid
07ac6a53c3
CalculateAverage_faridtmammadov (#406)
* create calculate average frd

* rename to mach github username

* add licesnce header

* make script executable

---------

Co-authored-by: Farid Mammadov <farid.mammadov@simbrella.com>
2024-01-15 21:01:16 +01:00
Jin Cong Ho
b7c24f95cd
Submission #2: jincongho (#416) 2024-01-15 20:48:32 +01:00
Thomas Wuerthinger
be179dcf07
Improve scheduling for thomaswue (#358)
* Improve scheduling for another 6%.

* Tune hash function and collision handling.
2024-01-15 20:43:12 +01:00
Bartłomiej Pietrzyk
c926aab444
Initial 1brc version by plbpietrz (#219)
* Initial version

* Small result merge optimisation

* Switched from reading bytes to longs

* Reading into internal buffer, test fixes

* Licence and minor string creation optimisation

* Hash collision fix
2024-01-15 20:30:04 +01:00
zerninv
d18b10708b
Sixth attempt CalculateAverage_zerninv.java (#407)
* rethink chunking

* fix typo
2024-01-15 20:25:52 +01:00
Vemana
6fe395cbae
Squashing a bunch of commits together. (#428)
Commit#2; Uplift of 7% using native byteorder from ByteBuffer.
Commit#1: Minor changes to formatting.

Co-authored-by: vemana <vemana.github@gmail.com>
2024-01-15 20:10:50 +01:00
Arjen Wisse
702d41df15
Small optimizations (#426) 2024-01-15 20:00:52 +01:00
Artsiom Korzun
987da54906
branchy version (#408) 2024-01-15 19:57:34 +01:00
eriklumme
785e517c14
CalculateAverage_eriklumme first submission (#221)
* Initial commit with custom implementation, 2:40

* Initial file-channel based version, 1:27

* Individual maps for executors, 0:54

* Use better-suited map: 0:34

* Verified correct, skip CharBuffer, :37

* Minor improvements and cleanup, 0:24

* String to byte[], 0:21

* Additional cleanup, use GraalVM, 0:17

* Faster number handling, 0:11

* Faster buffer reading, 0:08

* Prepare for environment with variable RAM and CPU, 0:08

* Fix bug causing issues with certain buffer sizes

* Larger overhead to not miss long station names that overlap buffers

* Reorder scripts and fix one-off bug
2024-01-15 19:03:51 +01:00
Dr Ian Preston
eaa4050a1b
12s (25%) faster on 4 core i7 (#421) 2024-01-15 18:58:23 +01:00
Jaromir Hamala
dbdd89a847
jerrinot's initial submission (#424)
* initial version

let's exploit that superscalar beauty!

* give credits where credits is due

also: added ideas I don't want to forget
2024-01-15 18:55:22 +01:00
Van Phu DO
677d94e5cf
Optimized with less constructor args + low collision mixer (#420)
* use all CPUs

* use graal

* optimized with less constructor arg

* optimized with low collision mixer
2024-01-15 18:53:31 +01:00
Marko Topolnik
ecab306338
10k improvement (#419)
* Remove commented-out params from the script

* General cleanup and refactoring

* Deoptimize parseTemperatureSimple

* Optimize nameEquals()
2024-01-15 18:49:32 +01:00
Pratham
6c7012a43e
Add improvements (#412)
- custom hashmap
- avoid string creation
- use graal
2024-01-15 18:47:06 +01:00
Eve
cd0e20b304
multithreaded version! (#415) 2024-01-15 18:39:36 +01:00
Bruno Félix
bb5679f463
Further improved performance by improving the parsing logic so that strings for city names are not allocated with each row. (#323)
Co-authored-by: Bruno Felix <bruno.felix@klarna.com>
2024-01-14 20:56:11 +01:00
zerninv
990f884ff1
change temperature parsing approach (#405) 2024-01-14 20:47:42 +01:00
unbounded
f9fb9bb384
Add implementation for user unbounded (#394)
Implementation that uses the Vector API for the following
 - scan for separators
 - calculate hash
 - n-way lookup in hash table
 - parse digits

e; fix queue size
2024-01-14 19:11:57 +01:00
Jesse Van Rooy
30987d778c
CalculateAverage_JesseVanRooy (Submission 1) (#335)
* Submission #1

* Submission #1 (Fixed casing of file names)

* Submission #1 (Added executable to Git permissions)

* Submission 1 (Fixed incorrect map size)

* Submission 1 (Fixed output problems on Windows)
2024-01-14 19:09:58 +01:00
Stefan Sprenger
3fbc4a2fa8
Update submission (#385)
* feat(flippingbits): Improve parsing of station names

* chore(flippingbits): Remove obsolete import

* feat(flippingbits): Use custom hash map

* feat(flippingbits): Use UNSAFE

* fix(flippingbits): Support very small files

* chore(flippingbits): Few cleanups

* chore(flippingbits): Align names

* fix(flippingbits): Initialize hash with first byte

* fix(flippingbits): Fix initialization of hash value
2024-01-14 19:06:01 +01:00
Arjen Wisse
fc6fca4315
My attempt to parse it quickly (#401)
* My approach

* Update calculate_average_arjenw.sh

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-14 19:03:07 +01:00
Jin Cong Ho
32bb237091
Initial Submission (#389)
Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-14 18:50:24 +01:00
Dmitry Bufistov
0ca7c485aa Dmitry challenge 2024-01-14 18:45:30 +01:00
Anita SV
3c36b5b0a8
A SAFE and readable version (#388)
* A SAFE and readable version

* Remove unused functions

* Making it slower, removing custom hashMap
2024-01-14 18:41:04 +01:00
tkosachev
1fd4712ed3 CalculateAverage_tkosachev
Runs 13.5 sec using 8 cores of i7-1265U laptop with 16 GB RAM.
2024-01-14 18:36:20 +01:00
Bruno Félix
6112c14044
Added license header to create_measurements.py (#403)
* Update create_measurements.py

Added license header to the python script to avoid breaking the build.

* Update src/main/python/create_measurements.py

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-14 18:29:48 +01:00
Charlie Evans
695760b31b
Charlibot - use memory mapping (#372)
* add memory map approach

* cleanup
2024-01-14 14:34:08 +01:00
Eadrom
e4f0891d2d
added python script to build test data (#366)
* added python script to build test data

* moved create_measurements.py to src/main/python and updated paths for file io

* Updated readme to include blurb about python script to generate measurements
2024-01-14 14:31:46 +01:00
Jaroslav Bachorik
865188ccee
Small improvements (#379) 2024-01-14 14:12:19 +01:00
Vemana
f11fad2a68
Submission #5 [No bitwise tricks nor Unsafe yet; 13th place on leaderboard in local testing using evaluate2.sh] (#209)
* Linear probe for city indexing. Beats current leader spullara 2.2 vs 3.8 elapsed time.

* Straightforward impl using bytebuffers. Turns out memorysegments were slower than used mappedbytebuffers.

* A initial submit-worthy entry

Comparison to select entries (averaged over 3 runs)
* spullara 1.66s [5th on leaderboard currently]
* vemana (this submission) 1.65s
* artsiomkorzun 1.64s [4th on leaderboard currently]

Tests: PASS
Impl Class: dev.morling.onebrc.CalculateAverage_vemana

Machine specs
* 16 core Ryzen 7950X
* 128GB RAM

Description
* Decompose the full file into Shards of memory mapped files and process
  each independently, outputting a TreeMap: City -> Statistics
* Compose the final answer by merging the individual TreeMap outputs
* Select 1 Thread per available processor as reported by the JVM
* Size to fit all datastructure in 0.5x L3 cache (4MB/core on the
  evaluation machines)
* Use linear probing hash table, with identity of city name = byte[] and
  hash code computed inline
* Avoid all allocation in the hot path and instead use method
  parameters. So, instead of passing a single Object param called Point(x, y, z),
  pass 3 parameters for each of its components. It is ugly, but this
  challenge is so far from Java's idioms anyway
* G1GC seems to want to interfere; use ParallelGC instead (just a quick
  and dirty hack)

Things tried that did not work
* MemorySegments are actually slower than MappedByteBuffers
* Trying to inline everything: not needed; the JIT compiler is pretty
  good
* Playing with JIT compiler flags didn't yield clear wins. In
  particular, was surprised that using a max level of 3 and reducing
  compilation threshold did nothing.. when the jit logs print that none
  of the methods reach level 4 and stay there for long
* Hand-coded implementation of Array.equals(..) using
  readLong(..) & bitmask_based_on_length from a bytebuffer instead of byte by byte

* Further tuning to compile loop methods: timings are now consistenctly ahead of artsiomkorzun in 4th place.

There are methods on the data path that were being interpreted for far
too long. For example, the method that takes a byte range and simply
calls one method per line was taking a disproportionate amount of time.
Using `-XX:+AlwaysCompileLoopMethods` option improved completion time by 4%.

============= vemana ===============
[20:55:22] [lsv@vemana]$ for i in 1 2 3 4 5; do ./runTheir.sh vemana;
done;

Using java version 21.0.1-graal in this shell.

real    0m1.581s
user    0m34.166s
sys     0m1.435s

Using java version 21.0.1-graal in this shell.

real    0m1.593s
user    0m34.629s
sys     0m1.470s

Using java version 21.0.1-graal in this shell.

real    0m1.632s
user    0m35.893s
sys     0m1.340s

Using java version 21.0.1-graal in this shell.

real    0m1.596s
user    0m33.074s
sys     0m1.386s

Using java version 21.0.1-graal in this shell.

real    0m1.611s
user    0m35.516s
sys     0m1.438s

============= artsiomkorzun ===============
[20:56:12] [lsv@vemana]$ for i in 1 2 3 4 5; do ./runTheir.sh
artsiomkorzun; done;

Using java version 21.0.1-graal in this shell.

real    0m1.669s
user    0m38.043s
sys     0m1.287s

Using java version 21.0.1-graal in this shell.

real    0m1.679s
user    0m37.840s
sys     0m1.400s

Using java version 21.0.1-graal in this shell.

real    0m1.657s
user    0m37.607s
sys     0m1.298s

Using java version 21.0.1-graal in this shell.

real    0m1.643s
user    0m36.852s
sys     0m1.392s

Using java version 21.0.1-graal in this shell.

real    0m1.644s
user    0m36.951s
sys     0m1.279s

============= spullara ===============
[20:57:55] [lsv@vemana]$ for i in 1 2 3 4 5; do ./runTheir.sh spullara;
done;

Using java version 21.0.1-graal in this shell.

real    0m1.676s
user    0m37.404s
sys     0m1.386s

Using java version 21.0.1-graal in this shell.

real    0m1.652s
user    0m36.509s
sys     0m1.486s

Using java version 21.0.1-graal in this shell.

real    0m1.665s
user    0m36.451s
sys     0m1.506s

Using java version 21.0.1-graal in this shell.

real    0m1.671s
user    0m36.917s
sys     0m1.371s

Using java version 21.0.1-graal in this shell.

real    0m1.634s
user    0m35.624s
sys     0m1.573s

========================== Running Tests ======================

[21:17:57] [lsv@vemana]$ ./runTests.sh vemana
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-10000-unique-keys.txt

Using java version 21.0.1-graal in this shell.

real    0m0.150s
user    0m1.035s
sys     0m0.117s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-10.txt

Using java version 21.0.1-graal in this shell.

real    0m0.114s
user    0m0.789s
sys     0m0.116s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-1.txt

Using java version 21.0.1-graal in this shell.

real    0m0.115s
user    0m0.948s
sys     0m0.075s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-20.txt

Using java version 21.0.1-graal in this shell.

real    0m0.113s
user    0m0.926s
sys     0m0.066s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-2.txt

Using java version 21.0.1-graal in this shell.

real    0m0.110s
user    0m0.734s
sys     0m0.078s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-3.txt

Using java version 21.0.1-graal in this shell.

real    0m0.114s
user    0m0.870s
sys     0m0.095s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-boundaries.txt

Using java version 21.0.1-graal in this shell.

real    0m0.113s
user    0m0.843s
sys     0m0.084s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-complex-utf8.txt

Using java version 21.0.1-graal in this shell.

real    0m0.121s
user    0m0.852s
sys     0m0.171s

* Improve by a few % more; now, convincingly faster than 6th place
submission. So far, only algorithms and tuning; no bitwise tricks yet.

Improve chunking implementation to avoid allocation and allow
finegrained chunking for the last X% of work. Work now proceeds in two
stages: big chunk stage and small chunk stage. This is to avoid
straggler threads holding up result merging.

Tests pass

[07:14:49] [lsv@vemana]$ ./test.sh vemana
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-10000-unique-keys.txt

Using java version 21.0.1-graal in this shell.

real    0m0.152s
user    0m0.973s
sys     0m0.107s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-10.txt

Using java version 21.0.1-graal in this shell.

real    0m0.113s
user    0m0.840s
sys     0m0.060s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-1.txt

Using java version 21.0.1-graal in this shell.

real    0m0.107s
user    0m0.681s
sys     0m0.085s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-20.txt

Using java version 21.0.1-graal in this shell.

real    0m0.105s
user    0m0.894s
sys     0m0.068s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-2.txt

Using java version 21.0.1-graal in this shell.

real    0m0.099s
user    0m0.895s
sys     0m0.068s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-3.txt

Using java version 21.0.1-graal in this shell.

real    0m0.098s
user    0m0.813s
sys     0m0.050s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-boundaries.txt

Using java version 21.0.1-graal in this shell.

real    0m0.095s
user    0m0.777s
sys     0m0.087s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-complex-utf8.txt

Using java version 21.0.1-graal in this shell.

real    0m0.112s
user    0m0.904s
sys     0m0.069s

* Merge results from finished threads instead of waiting for all threads
to finish.

Not a huge difference overall but no reason to wait.

Also experiment with a few other compiler flags and attempt to use
jitwatch to understand what the jit is doing.

* Move to prepare_*.sh format and run evaluate2.sh locally.

Shows 7th place in leaderboard

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes
|
|---|-----------------|--------------------|-----|---------------|-----------|
| 1 | 00:01.588 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_thomaswue.java)|
21.0.1-graal | [Thomas Wuerthinger](https://github.com/thomaswue) |
   GraalVM native binary |
| 2 | 00:01.866 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_merykitty.java)|
21.0.1-open | [Quan Anh Mai](https://github.com/merykitty) |  |
| 3 | 00:01.904 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_royvanrijn.java)|
21.0.1-graal | [Roy van Rijn](https://github.com/royvanrijn) |  |
|   | 00:02.398 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_ebarlas.java)|
21.0.1-graal | [Elliot Barlas](https://github.com/ebarlas) |  |
|   | 00:02.724 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_obourgain.java)|
21.0.1-open | [Olivier Bourgain](https://github.com/obourgain) |  |
|   | 00:02.771 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_algirdasrascius.java)|
21.0.1-open | [Algirdas Ra__ius](https://github.com/algirdasrascius) |
   |
|   | 00:02.842 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_vemana.java)|
21.0.1-graal | [Vemana](https://github.com/vemana) |  |
|   | 00:02.902 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_spullara.java)|
21.0.1-graal | [Sam Pullara](https://github.com/spullara) |  |
|   | 00:02.906 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_artsiomkorzun.java)|
21.0.1-graal | [artsiomkorzun](https://github.com/artsiomkorzun) |  |
|   | 00:02.970 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_isolgpus.java)|
21.0.1-open | [Jamie Stansfield](https://github.com/isolgpus) |  |

* Tune chunksize to get another 2% improvement for 8 processors as used by
the evaluation script.

* Read int at a time for city name length detection; speeds up by 2% in local testing.

* Improve reading temperature double by exiting loop quicker; no major
tricks (like reading an int) yet, but good for 5th place on leaderboard in local testing.

This small change has caused a surprising gain in performance by about 4%.
I didn't expect such a big change, but perhaps in combination with the
earlier change to read int by int for the city name, temperature reading
is dominating that aspect of the time. Also, perhaps the quicker exit
(as soon as you see '.' instead of reading until '\n') means you get to
simply skip reading the '\n' across each of the lines. Since the lines
are on average like 15 characters, it may be that avoiding reading the \n
is a meaningful saving. Or maybe the JIT found a clever optimization for
reading the temperature.

Or maybe it is simply the case that the number of multiplications is now
down to 2 from the previous 3 is what's causing the performance gain?

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes
|
|---|-----------------|--------------------|-----|---------------|-----------|
| 1 | 00:01.531 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_thomaswue.java)|
21.0.1-graal | [Thomas Wuerthinger](https://github.com/thomaswue) |
   GraalVM native binary |
| 2 | 00:01.794 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_royvanrijn.java)|
21.0.1-graal | [Roy van Rijn](https://github.com/royvanrijn) |  |
| 3 | 00:01.956 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_merykitty.java)|
21.0.1-open | [Quan Anh Mai](https://github.com/merykitty) |  |
|   | 00:02.346 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_ebarlas.java)|
21.0.1-graal | [Elliot Barlas](https://github.com/ebarlas) |  |
|   | 00:02.673 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_vemana.java)|
21.0.1-graal | [Subrahmanyam](https://github.com/vemana) |  |
|   | 00:02.689 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_obourgain.java)|
21.0.1-open | [Olivier Bourgain](https://github.com/obourgain) |  |
|   | 00:02.785 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_algirdasrascius.java)|
21.0.1-open | [Algirdas Ra__ius](https://github.com/algirdasrascius) |
   |
|   | 00:02.926 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_isolgpus.java)|
21.0.1-open | [Jamie Stansfield](https://github.com/isolgpus) |  |
|   | 00:02.928 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_artsiomkorzun.java)|
21.0.1-graal | [Artsiom Korzun](https://github.com/artsiomkorzun) |  |
|   | 00:02.932 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_spullara.java)|
21.0.1-graal | [Sam Pullara](https://github.com/spullara) |  |

* Reduce one multiplication when temperature is +ve.

* Linear probe for city indexing. Beats current leader spullara 2.2 vs 3.8 elapsed time.

* Straightforward impl using bytebuffers. Turns out memorysegments were slower than used mappedbytebuffers.

* A initial submit-worthy entry

Comparison to select entries (averaged over 3 runs)
* spullara 1.66s [5th on leaderboard currently]
* vemana (this submission) 1.65s
* artsiomkorzun 1.64s [4th on leaderboard currently]

Tests: PASS
Impl Class: dev.morling.onebrc.CalculateAverage_vemana

Machine specs
* 16 core Ryzen 7950X
* 128GB RAM

Description
* Decompose the full file into Shards of memory mapped files and process
  each independently, outputting a TreeMap: City -> Statistics
* Compose the final answer by merging the individual TreeMap outputs
* Select 1 Thread per available processor as reported by the JVM
* Size to fit all datastructure in 0.5x L3 cache (4MB/core on the
  evaluation machines)
* Use linear probing hash table, with identity of city name = byte[] and
  hash code computed inline
* Avoid all allocation in the hot path and instead use method
  parameters. So, instead of passing a single Object param called Point(x, y, z),
  pass 3 parameters for each of its components. It is ugly, but this
  challenge is so far from Java's idioms anyway
* G1GC seems to want to interfere; use ParallelGC instead (just a quick
  and dirty hack)

Things tried that did not work
* MemorySegments are actually slower than MappedByteBuffers
* Trying to inline everything: not needed; the JIT compiler is pretty
  good
* Playing with JIT compiler flags didn't yield clear wins. In
  particular, was surprised that using a max level of 3 and reducing
  compilation threshold did nothing.. when the jit logs print that none
  of the methods reach level 4 and stay there for long
* Hand-coded implementation of Array.equals(..) using
  readLong(..) & bitmask_based_on_length from a bytebuffer instead of byte by byte

* Further tuning to compile loop methods: timings are now consistenctly ahead of artsiomkorzun in 4th place.

There are methods on the data path that were being interpreted for far
too long. For example, the method that takes a byte range and simply
calls one method per line was taking a disproportionate amount of time.
Using `-XX:+AlwaysCompileLoopMethods` option improved completion time by 4%.

============= vemana ===============
[20:55:22] [lsv@vemana]$ for i in 1 2 3 4 5; do ./runTheir.sh vemana;
done;

Using java version 21.0.1-graal in this shell.

real    0m1.581s
user    0m34.166s
sys     0m1.435s

Using java version 21.0.1-graal in this shell.

real    0m1.593s
user    0m34.629s
sys     0m1.470s

Using java version 21.0.1-graal in this shell.

real    0m1.632s
user    0m35.893s
sys     0m1.340s

Using java version 21.0.1-graal in this shell.

real    0m1.596s
user    0m33.074s
sys     0m1.386s

Using java version 21.0.1-graal in this shell.

real    0m1.611s
user    0m35.516s
sys     0m1.438s

============= artsiomkorzun ===============
[20:56:12] [lsv@vemana]$ for i in 1 2 3 4 5; do ./runTheir.sh
artsiomkorzun; done;

Using java version 21.0.1-graal in this shell.

real    0m1.669s
user    0m38.043s
sys     0m1.287s

Using java version 21.0.1-graal in this shell.

real    0m1.679s
user    0m37.840s
sys     0m1.400s

Using java version 21.0.1-graal in this shell.

real    0m1.657s
user    0m37.607s
sys     0m1.298s

Using java version 21.0.1-graal in this shell.

real    0m1.643s
user    0m36.852s
sys     0m1.392s

Using java version 21.0.1-graal in this shell.

real    0m1.644s
user    0m36.951s
sys     0m1.279s

============= spullara ===============
[20:57:55] [lsv@vemana]$ for i in 1 2 3 4 5; do ./runTheir.sh spullara;
done;

Using java version 21.0.1-graal in this shell.

real    0m1.676s
user    0m37.404s
sys     0m1.386s

Using java version 21.0.1-graal in this shell.

real    0m1.652s
user    0m36.509s
sys     0m1.486s

Using java version 21.0.1-graal in this shell.

real    0m1.665s
user    0m36.451s
sys     0m1.506s

Using java version 21.0.1-graal in this shell.

real    0m1.671s
user    0m36.917s
sys     0m1.371s

Using java version 21.0.1-graal in this shell.

real    0m1.634s
user    0m35.624s
sys     0m1.573s

========================== Running Tests ======================

[21:17:57] [lsv@vemana]$ ./runTests.sh vemana
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-10000-unique-keys.txt

Using java version 21.0.1-graal in this shell.

real    0m0.150s
user    0m1.035s
sys     0m0.117s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-10.txt

Using java version 21.0.1-graal in this shell.

real    0m0.114s
user    0m0.789s
sys     0m0.116s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-1.txt

Using java version 21.0.1-graal in this shell.

real    0m0.115s
user    0m0.948s
sys     0m0.075s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-20.txt

Using java version 21.0.1-graal in this shell.

real    0m0.113s
user    0m0.926s
sys     0m0.066s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-2.txt

Using java version 21.0.1-graal in this shell.

real    0m0.110s
user    0m0.734s
sys     0m0.078s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-3.txt

Using java version 21.0.1-graal in this shell.

real    0m0.114s
user    0m0.870s
sys     0m0.095s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-boundaries.txt

Using java version 21.0.1-graal in this shell.

real    0m0.113s
user    0m0.843s
sys     0m0.084s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-complex-utf8.txt

Using java version 21.0.1-graal in this shell.

real    0m0.121s
user    0m0.852s
sys     0m0.171s

* Improve by a few % more; now, convincingly faster than 6th place
submission. So far, only algorithms and tuning; no bitwise tricks yet.

Improve chunking implementation to avoid allocation and allow
finegrained chunking for the last X% of work. Work now proceeds in two
stages: big chunk stage and small chunk stage. This is to avoid
straggler threads holding up result merging.

Tests pass

[07:14:49] [lsv@vemana]$ ./test.sh vemana
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-10000-unique-keys.txt

Using java version 21.0.1-graal in this shell.

real    0m0.152s
user    0m0.973s
sys     0m0.107s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-10.txt

Using java version 21.0.1-graal in this shell.

real    0m0.113s
user    0m0.840s
sys     0m0.060s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-1.txt

Using java version 21.0.1-graal in this shell.

real    0m0.107s
user    0m0.681s
sys     0m0.085s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-20.txt

Using java version 21.0.1-graal in this shell.

real    0m0.105s
user    0m0.894s
sys     0m0.068s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-2.txt

Using java version 21.0.1-graal in this shell.

real    0m0.099s
user    0m0.895s
sys     0m0.068s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-3.txt

Using java version 21.0.1-graal in this shell.

real    0m0.098s
user    0m0.813s
sys     0m0.050s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-boundaries.txt

Using java version 21.0.1-graal in this shell.

real    0m0.095s
user    0m0.777s
sys     0m0.087s
Validating calculate_average_vemana.sh --
src/test/resources/samples/measurements-complex-utf8.txt

Using java version 21.0.1-graal in this shell.

real    0m0.112s
user    0m0.904s
sys     0m0.069s

* Merge results from finished threads instead of waiting for all threads
to finish.

Not a huge difference overall but no reason to wait.

Also experiment with a few other compiler flags and attempt to use
jitwatch to understand what the jit is doing.

* Move to prepare_*.sh format and run evaluate2.sh locally.

Shows 7th place in leaderboard

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes
|
|---|-----------------|--------------------|-----|---------------|-----------|
| 1 | 00:01.588 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_thomaswue.java)|
21.0.1-graal | [Thomas Wuerthinger](https://github.com/thomaswue) |
   GraalVM native binary |
| 2 | 00:01.866 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_merykitty.java)|
21.0.1-open | [Quan Anh Mai](https://github.com/merykitty) |  |
| 3 | 00:01.904 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_royvanrijn.java)|
21.0.1-graal | [Roy van Rijn](https://github.com/royvanrijn) |  |
|   | 00:02.398 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_ebarlas.java)|
21.0.1-graal | [Elliot Barlas](https://github.com/ebarlas) |  |
|   | 00:02.724 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_obourgain.java)|
21.0.1-open | [Olivier Bourgain](https://github.com/obourgain) |  |
|   | 00:02.771 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_algirdasrascius.java)|
21.0.1-open | [Algirdas Ra__ius](https://github.com/algirdasrascius) |
   |
|   | 00:02.842 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_vemana.java)|
21.0.1-graal | [Vemana](https://github.com/vemana) |  |
|   | 00:02.902 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_spullara.java)|
21.0.1-graal | [Sam Pullara](https://github.com/spullara) |  |
|   | 00:02.906 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_artsiomkorzun.java)|
21.0.1-graal | [artsiomkorzun](https://github.com/artsiomkorzun) |  |
|   | 00:02.970 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_isolgpus.java)|
21.0.1-open | [Jamie Stansfield](https://github.com/isolgpus) |  |

* Tune chunksize to get another 2% improvement for 8 processors as used by
the evaluation script.

* Read int at a time for city name length detection; speeds up by 2% in local testing.

* Improve reading temperature double by exiting loop quicker; no major
tricks (like reading an int) yet, but good for 5th place on leaderboard in local testing.

This small change has caused a surprising gain in performance by about 4%.
I didn't expect such a big change, but perhaps in combination with the
earlier change to read int by int for the city name, temperature reading
is dominating that aspect of the time. Also, perhaps the quicker exit
(as soon as you see '.' instead of reading until '\n') means you get to
simply skip reading the '\n' across each of the lines. Since the lines
are on average like 15 characters, it may be that avoiding reading the \n
is a meaningful saving. Or maybe the JIT found a clever optimization for
reading the temperature.

Or maybe it is simply the case that the number of multiplications is now
down to 2 from the previous 3 is what's causing the performance gain?

| # | Result (m:s.ms) | Implementation     | JDK | Submitter     | Notes
|
|---|-----------------|--------------------|-----|---------------|-----------|
| 1 | 00:01.531 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_thomaswue.java)|
21.0.1-graal | [Thomas Wuerthinger](https://github.com/thomaswue) |
   GraalVM native binary |
| 2 | 00:01.794 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_royvanrijn.java)|
21.0.1-graal | [Roy van Rijn](https://github.com/royvanrijn) |  |
| 3 | 00:01.956 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_merykitty.java)|
21.0.1-open | [Quan Anh Mai](https://github.com/merykitty) |  |
|   | 00:02.346 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_ebarlas.java)|
21.0.1-graal | [Elliot Barlas](https://github.com/ebarlas) |  |
|   | 00:02.673 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_vemana.java)|
21.0.1-graal | [Subrahmanyam](https://github.com/vemana) |  |
|   | 00:02.689 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_obourgain.java)|
21.0.1-open | [Olivier Bourgain](https://github.com/obourgain) |  |
|   | 00:02.785 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_algirdasrascius.java)|
21.0.1-open | [Algirdas Ra__ius](https://github.com/algirdasrascius) |
   |
|   | 00:02.926 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_isolgpus.java)|
21.0.1-open | [Jamie Stansfield](https://github.com/isolgpus) |  |
|   | 00:02.928 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_artsiomkorzun.java)|
21.0.1-graal | [Artsiom Korzun](https://github.com/artsiomkorzun) |  |
|   | 00:02.932 |
[link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_spullara.java)|
21.0.1-graal | [Sam Pullara](https://github.com/spullara) |  |

* Reduce one multiplication when temperature is +ve.

* Added some documentation on the approach.

---------

Co-authored-by: vemana <vemana.github@gmail.com>
2024-01-14 14:07:03 +01:00
Ragnar Groot Koerkamp
b56f2205c2 Update CreateMeasurements3.java to write measurements3.txt
Currently it overwrites measurements.txt which is a bit confusing.
2024-01-14 14:00:10 +01:00
Cliff Click
14a0100265
BRC Entry (#185)
* BRC Entry

* Fix test cases

* Fix last bug, a little re-org

* Now with Unsafe!

* A little more Unsafe
2024-01-14 11:08:55 +01:00
Gunnar Morling
7816e32b7b #49 Fixing rounding behavior of baseline implementation 2024-01-14 10:59:24 +01:00
Marko Topolnik
8d389a907b Add rounding error test case 2024-01-14 10:59:24 +01:00
Elliot Barlas
d608f14886 Consider file size when calculating partition count. Add simple fast-path optimization to equals method. 2024-01-14 10:24:52 +01:00
Kidlike
c01668403a
submission for kidlike (#294)
* first version

* second version (0m59s)

* third version (0m46s)

* fourth version (0m39s)

* fifth version (0m18s)

* follow naming conventions from project structure

* fix rounding (see /issues/49)

* formatting changes from build

* name should case-match github username

* sixth version (14s)

* seventh version (11s)

* potential fix for other systems?

* no need for sdk install

* binary should go to ./target

* building native-image only when not existing yet
2024-01-13 22:22:36 +01:00
Vasily Zernin
32143b2a4c change chunking formula and some refactoring 2024-01-13 22:13:05 +01:00
jairo
4265c7e9a8 simultaneous reading and calculation, reduction of memory consumption, hashing for the stations 2024-01-13 22:11:33 +01:00
abeobk
b2a4b73c59 use all CPUs 2024-01-13 22:04:34 +01:00
ivanklaric
05fe916948
my 1brc entry (#367) 2024-01-13 22:02:36 +01:00
Jatin Gala
47103cd84e
1brc challange submission jatingala (#364)
* add code

* enable parallel

* fix code warnings

* use graal vm

* formatting changes by build

* add license
2024-01-13 21:44:42 +01:00
javamak
e5540214b8
CalculateAverage_javamak (#360) 2024-01-13 21:41:42 +01:00
Vaidhy Mayilrangam
33c614a1e3
Primitive hash (#345)
* Calculate average by vaidhy

* Calculate average by vaidhy

* More changes

* remove worker log

* Pass -Dparellelism and switch back to open

* Try out mmap

* Improve mmap solution

* no copy version

* reduce threads

* hash code computed on the fly

* Reuse the char (Do not know if it helps)

* primitive hash map

* Primite HashMap

* Micro optimizations to push for optimizations

* Revert "Micro optimizations to push for optimizations"

This reverts commit ea333e2821ebb5c1d6d71a4e87e569a8f2f8f7f0.

* Micro optimizations to get the juice

* floorMod fixes

* findSemi and findNewLine as separate functions

* Optimized parseDouble

* More micro changes

* Aligned equal check

* more small changes

* XOR instead of compare

* Reduce loop length

* Revert changes

* Loop optimization and added native build

* Hand unrolled findSemi loop.

* Remove incorrect comments

* Taking care fo PR comments

* Add prepare script

* Missing header error fix

* remove wrong comment

---------

Co-authored-by: Anita S V <anitasvasu@gmail.com>
Co-authored-by: Anita SV <anitvasu@amazon.com>
2024-01-13 18:46:51 +01:00
Bang NGUYEN
dc49249d36
[Attempt #2] String overflow hash + data/mem optimization (#356)
* Use graal

* Use dynamic cores computer

* Use stream API to cleanup code

* Use max processors

* Use hash to avoid init string

* optimize concurrentmap init

* Smaller hash size

* Avoid checking concurrentmap

* Optimize data type

* string dedup

* Faster write

* Change base

* Remove time

* Use mul instead of div
2024-01-13 12:32:17 +01:00
Oleh Marchenko
e1ae96f297
First version of implementation - omarchenko4j (#222)
* First version of implementation

* Fixes after running script test
2024-01-13 11:52:17 +01:00