Commit Graph

687 Commits

Author SHA1 Message Date
John Ziamos
97334e8621
use long for string equals (#613)
use more generic hashcode
2024-01-28 17:03:42 +01:00
Jonathan Wright
8ef22ab1bd
Initial submission for jonathan_aotearoa. (#586)
* Initial submission for jonathan_aotearoa

* Fixing typos

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

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

* Fixing typo.

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

* Additional assertion, comment improvements.

* Refactoring to improve testability. Additional assertion and comments.

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

* Minor refactoring to make param ordering consistent.

* Adding a custom toString method for the results map.

* Fixing collision checking bug

* Fixing rounding bug.

* Fixing collision bug.

---------

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

* use munmap() trick
credit: thomaswue

* some smaller tweaks

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

* Rename to be valid with rules

* CalculateAverage_pdrakatos

* Rename to be valid with rules

* Changes on scripts execution

* Fixing bugs causing scripts not to be executed

* Changes on prepare make it compatible

* Fixing passing all tests

* Increase direct memory allocation buffer

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

* Use byte arrays of size 2^20

---------

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

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

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

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

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

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

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

* improved integer conversion, delayed string creation.

* new algorithm hash, use ConcurrentHashMap

* fix rounding test

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

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

* Final impl gigiblender
2024-01-27 15:20:02 +01:00
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
Gunnar Morling
22c188b148 Leaderboard update 2024-01-26 18:23:07 +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
Gunnar Morling
09b0d75477 Leaderboard update 2024-01-25 23:37:52 +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
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