Commit Graph

509 Commits

Author SHA1 Message Date
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
Van Phu DO
271bdfb032
Simplify Node class with less field, improve hash mix speed (#584)
* Simplify Node class with less field, improve hash mix speed

* remove some ops, a bit faster

* more inline, little bit faster but not sure
2024-01-25 22:57:04 +01:00
gabrielfoo
ce9455a584
gabrielfoo's first attempt (#556)
* first attempt

* formatting fix

---------

Co-authored-by: Gabriel <gabriel@gabriel>
2024-01-25 22:46:40 +01:00
Vemana
80cd738b4b
C style code. Should be ~4secs or lower based on local testing. (#559)
1. Use Unsafe
2. Fit hashtable in L2 cache.
3. If we can find a good hash function, it can fit in L1 cache even.
4. Improve temperature parsing by using a lookup table
2024-01-25 22:40:14 +01:00
Gunnar Morling
561717a986
Update README.md 2024-01-24 20:37:10 +01:00
Gunnar Morling
0b762ee0b0
Fixing Thomas' JDK version 2024-01-24 12:18:01 +01:00
Gunnar Morling
7a9b88f328 Leaderboard 2024-01-24 10:57:28 +01:00
Gunnar Morling
055916e997 Leaderboard update 2024-01-24 10:56:03 +01:00
Alexander Yastrebov
4daeb94b04
Go implementation by AlexanderYastrebov (#298)
* Go implementation by AlexanderYastrebov

This is a proof-of-concept to demonstrate non-java submission.
It requires Docker with BuildKit plugin to build and export binary.

Updates
* #67
* #253

* Use collision-free id lookup

* Use number of buckets greater than max number of keys
2024-01-23 20:49:28 +01:00
Laake Scates-Gervasi
464ba6209b
Laake Scates-Gervasi first submission (justplainlaake) [2.5s execution, locally similar time to top 5] (#431)
* Init Push

* organize imports

* Add OpenMap

* Best outcome yet

* Create prepare script and calculate script for native image, also add comments on calculation

* Remove extra hashing, and need for the set array

* Commit formatting changes from build

* Remove unneeded device information

* Make shell scripts executable, add hash collision double check for equality

* Add hash collision double check for equality

* Skip multithreading for small files to improve small file performance
2024-01-23 20:44:57 +01:00
Roy van Rijn
7ced63f460
Rewrote to always read 16 bytes, this has less instructions on perf. (#562)
It doesn't make a lot of sense since quite some code can be written shorter, but this is what gives the best numbers.
2024-01-23 20:37:09 +01:00
3j5a
a9a05599cd
CalculateAverage_3j5a off-the-shelf Java components + ArraysSupport (#566)
* off the shell Java components, curious about official runtime results. thnx

my laptop results are around 12 seconds, e.g:
87.66user 1.32system 0:12.11elapsed 734%CPU (0avgtext+0avgdata 13980924maxresident)k

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0-7
Vendor ID:               GenuineIntel
  Model name:            Intel(R) Core(TM) i5-8400H CPU @ 2.50GHz

* off-the-shelf Java components... curious about official runtime results. thnx

laptop results are around 11 seconds, e.g:
./calculate_average_3j5a.sh  81.46s user 1.36s system 758% cpu 10.917 total

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0-7
Vendor ID:               GenuineIntel
  Model name:            Intel(R) Core(TM) i5-8400H CPU @ 2.50GHz

* off-the-shelf Java components + ArraysSupport..

laptop results are around 10.2 seconds, e.g:
./calculate_average_3j5a.sh  75.02s user 1.31s system 750% cpu 10.175 total

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0-7
Vendor ID:               GenuineIntel
  Model name:            Intel(R) Core(TM) i5-8400H CPU @ 2.50GHz

* method handle...

* full buffer read attempt

* MH

* MH cleanup
2024-01-23 20:31:45 +01:00
Mathias Bjerke
337642d1ec
1brc contribution from mattiz (first attempt) (#567)
* Contribution from mattiz

* Formatted code
2024-01-23 20:28:58 +01:00
karthikeyan97
292edc629f
fine tuning performance further (#526)
* 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-23 20:21:52 +01:00
Roman Musin
6c0949969a
Native image + a few smaller optimisations (#564)
* Inline parsing name and station to avoid constantly updating the offset field (-100ms)

* Remove Worker class, inline the logic into lambda

* Accumulate results in an int matrix instead of using result row (-50ms)

* Use native image
2024-01-23 20:19:07 +01:00
yourwass
ba793e88cd
Add Yourwass take on the challenge (#532)
* Uses vector api for city name parsing and for hash index collision resolution
* Uses lookup tables for temperature parsing
2024-01-23 20:04:55 +01:00
Yann Moisan
b3420d9348
improvements (#521)
- inline computeIfAbsent
- replace arraycopy by copyOfRange

Co-authored-by: Yann Moisan <yann@zen.ly>
2024-01-23 19:58:10 +01:00
Parker Timmins
c886aaba34
Deploy v2 for parkertimmins (#524)
* Deploy v2 for parkertimmins

Main changes:
- fix hash which masked incorrectly
- do station equality check in simd
- make station array length multiple of 32
- search for newline rather than semicolon

* Fix bug - entries were being skipped between batches

At the boundary between two batches, the first batch would stop after
crossing a limit with a padding of 200 characters applied. The next
batch should then start looking for the first full entry after the
padding. This padding logic had been removed when starting a batch. For
this reason, entries starting in the 200 character padding between
batches were skipped.
2024-01-23 19:43:34 +01:00
Artsiom Korzun
d858959097
parse value before going to map (#548)
parse value before going to map
2024-01-23 19:38:32 +01:00
Gaurav Anantrao Deshmukh
46d2058bd4
First optimal solution attempt (#539)
* First optimal attempt

* Removing debug lines

* Using default string equals method

---------

Co-authored-by: Gaurav Deshmukh <deshmgau@amazon.com>
2024-01-23 19:32:03 +01:00
Gerd Aschemann
c232346e87
#540 Cache SDKman (#554)
IMPORTANT: Only use SDKman provided Java - System JDK no longer installed!
2024-01-23 19:13:13 +01:00
Jeevjyot Singh Chhabda
415b3eb5c5
b1rc challenge by @jeevjyot (#551)
* b1rc challenge

* fixed a rounding error

* added the file back

* fixed file

* removed a file

---------

Co-authored-by: Jeevjyot Singh Chhabda <jeevjyotsinghchhabda@Jeevjyots-MBP.hsd1.ca.comcast.net>
2024-01-23 18:43:58 +01:00
Jaromir Hamala
2c432abb96
jerrinot's improvement - fast-path for short keys (#545)
* fast-path for keys<16 bytes

* fix off by one error

the mask is wrong for he 2nd word when len == 16

* less chunks per thread

seems like compact code wins. on my test box anyway.
2024-01-23 18:29:22 +01:00
Marek Kohn
2be84e09ee
Add 1brc solution by @makohn (#544) 2024-01-23 18:26:53 +01:00
Rene Schwietzke
6cf6da0c17
Added environment docs (#555)
* Create ENVIRONMENT.md

* More intel added
2024-01-23 18:21:36 +01:00
Gunnar Morling
95c0fb06b0 Leaderboard update 2024-01-23 18:16:12 +01:00
Van Phu DO
98a8279669
use thomaswue trick, use parallelism, slightly faster (#560) 2024-01-23 16:41:25 +01:00
Dr Ian Preston
8bae1b8781
Use simd for name comparison (#568)
Co-authored-by: Ian Preston <ianopolous@protonmail.com>
2024-01-23 16:37:33 +01:00
Antonio Muñoz
f7febea2f6
tonivade implementation (try 2) (#541)
* tonivade implementation

* synchronized block performs better than ReentrantLock

* remove ConcurrentHashMap

* refactor

* use HashMap.newHashMap

* change double to int

* minor refactor

* fix
2024-01-23 16:35:05 +01:00
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
Sarkie
e16ad7660d
Update README.md to add the _baseline (#552) 2024-01-22 11:00:01 +01:00
Jason Nochlin
b374643a1f
evaluate.sh: Add note for "using Unsafe" (#547)
* fix typo

* automatically label entries using Unsafe

* fix for entry in src/main/java-22/

* backfill leaderboard

---------

Co-authored-by: Jason Nochlin <hundredwatt@users.noreply.github.com>
2024-01-22 09:20:26 +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
Gunnar Morling
81963f963c Leaderboard update 2024-01-21 20:39:20 +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
Gunnar Morling
d135bd9521 Leaderboard update 2024-01-21 18:01:52 +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
Gunnar Morling
3e1951379a #104 Running tests for PRs 2024-01-21 17:44:35 +01:00
Gunnar Morling
38c3e0f1ee Leaderboard update 2024-01-21 13:43:40 +01:00
Van Phu DO
410425c833
reorganize code, little bit faster (#509) 2024-01-21 13:25:18 +01:00