Commit Graph

145 Commits

Author SHA1 Message Date
Gunnar Morling
b0c9952c08 Leaderboard, formatting 2024-01-11 10:48:03 +01:00
David Kopec
780ab9af3e
Update davecom entry use ByteBuffer instead of String for Names and graal (#245)
* my implementation about 19.5 seconds on M1 MacBook Air

* final version

* use ByteBuffer instead of String; use graal

* add prepare_davecom script
2024-01-11 10:24:25 +01:00
Charlie Evans
c887202206
Charlibot submission (#249)
* committing my ugly code

* fulfil the brief wrt number of characters and the number of cities

* prepare submission
2024-01-11 10:01:06 +01:00
kumarsaurav123
99dd18b672
CalculateAverage_kumarsaurav123.java-> RAM 16 GB CPU 32 Core (#247) 2024-01-11 09:55:24 +01:00
Aleš Justin
965e852ba7
Simple, slow but very short. :-) (#240)
* Simple, slow but very short. :-)

* Fix sync on DSS::accept.
2024-01-11 09:48:27 +01:00
Artsiom Korzun
8602a35504
improved artsiomkorzun solution (#176)
improved artsiomkorzun solution

improved artsiomkorzun solution

Co-authored-by: Artsiom Korzun <akorzun@deltixlab.com>
2024-01-11 09:00:24 +01:00
Anthony Goubard
e7ab90e3ac
Implementation CalculateAverage_japplis of 1BRC from Anthony Goubard (#271)
* Implementation CalculateAverage_japplis of 1BRC from Anthony Goubard (japplis).
Local performance (7 years old desktop i7-6700K - 8 cores - 16GB) 26 seconds. For reference, Jamie Stansfield (isolgpus) is 23 seconds on my machine and 11s in your results.
I've added the nbactions.xml to the .gitignore file. When you add in NetBeans options like --enable-preview to actions like debug file or run file, it creates this file.

* Implementation CalculateAverage_japplis of 1BRC from Anthony Goubard (japplis).
Local performance (7 years old desktop i7-6700K - 8 cores - 16GB) 26 seconds. For reference, Jamie Stansfield (isolgpus) is 23 seconds on my machine and 11s in your results.
I've added the nbactions.xml to the .gitignore file. When you add in NetBeans options like --enable-preview to actions like debug file or run file, it creates this file.
second commit: Removed BufferedInputStream and replaced Measurement with IntSummaryStatistics (thanks davecom): still 23" but cleaner code
2024-01-10 23:09:21 +01:00
pedestrianlove
3f2fd934e5
Add entries for pedestrianlove. (#265)
Co-authored-by: jsl <s03851050@go.thu.edu.tw>
2024-01-10 22:57:41 +01:00
Pratham
473791e188
first cut 1brc submission (#216)
* phd3 initial entry

* Optimize parsing doubles

* Remove redundant check

* Update calculate_average_phd3.sh

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-10 22:40:27 +01:00
Algirdas Raščius
d17619c95c
Quick and dirty first version (#215)
* Quick and dirty first version

* Update script to new standard
2024-01-10 22:35:37 +01:00
Anton Rybochkin
ad7a6ec573
Initial solution by raipc
* Initial solution by raipc

* Implemented custom hash map with open addressing

* Small optimizations to task splitting and range check disabling

* Fixed off-by-one error in merge

* Run with EpsilonGC. Borrowed VM params from Shipilev

* Make script executable

* Add a license
2024-01-10 22:26:00 +01:00
Michael Berry
1589210038
Initial implementation (#158)
* Initial implementation

* Make executable

* Deal with collisions (but very slow)

* Formatting

* Remove superfluous time

* Formatting

* Fixes

* Remove hard coded correction line

* Integer parsing speedup
2024-01-10 22:17:11 +01:00
arjenvaneerde
d4fdcc5408
Some optimizations arjenvaneerde
* First working version.

* Small adjustments.

* Correct number of threads.

* Sync

* Some fixes. To LF instead of CRLF.

* Parallel reading and processing.

* Update CreateMeasurements.java

* Update CalculateAverage.java

* Small fix for bug in switching buffers.

* Update calculate_average_arjenvaneerde.sh

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-10 22:06:28 +01:00
zerninv
814c88fcb5
Implements CalculateAverage_zerninv.java
* initial attempt

* adjust to new evaluation env

* fix tests

* fix typo

* some numbers adjustments

* Update calculate_average_zerninv.sh

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-10 21:53:34 +01:00
AbstractKamen
7483b90cec
CalculateAverage_AbstractKamen
* initial commit

* first attempt: segment the file and process it in parallel

* remove commented stuff

* custom parseDouble for this simple case

* fixed some issues and improved parsing

* format

* Update calculate_average_AbstractKamen.sh

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-10 21:48:12 +01:00
Gunnar Morling
209e005461 Leaderboard, clean-up 2024-01-10 21:37:16 +01:00
Gaurav Mathur
20f0179181
gnmathur's solution (#202)
Co-authored-by: Gaurav Mathur <gmathur@gurukul>
2024-01-10 21:36:29 +01:00
CourageLee
c9b7fe9deb
Add CalculateAverage_couragelee Java class and shell script
This commit introduces a new java class, CalculateAverage_couragelee, and a shell script for calculating averages. The java class utilizes NIO's memory-mapping and parallel computing techniques to perform calculations. These changes should improve the efficiency and speed of average calculations.
2024-01-10 21:16:36 +01:00
Prabhu R
1086385f1f
Implementation by rprabhu
Co-authored-by: Prabhu R <prabhu.rengaswamy@outlook.com>
2024-01-10 21:09:42 +01:00
greid
08af2622d3 gabrielreid take 2
Clear up some TODOS, simplify the code a bit, which appears to
result in a 25% performance increase.
2024-01-10 20:43:46 +01:00
Stefan Sprenger
a8a3876416
Second submission by flippingbits - 50% performance improvement
* feat(flippingbits): Improve parsing of measurement and few cleanups

* feat(flippingbits): Reduce chunk size to 10MB

* feat(flippingbits): Improve parsing of station names

* chore(flippingbits): Remove obsolete import

* chore(flippingbits): Few cleanups
2024-01-10 20:36:22 +01:00
Quan Anh Mai
97b1f014ad
merykitty's second attempt 2024-01-10 20:24:19 +01:00
Elliot Barlas
44414a33dc Consume four bytes at a time from buffer using getInt. Store key with unsafe int array rather than byte array. Use custom equals rather than Arrays equals. 2024-01-10 20:03:14 +01:00
Thomas Wuerthinger
af66ac145f
Second tuning for thomaswue
* Optimize checking for collisions by doing this a long at a time always.

* Use a long at a time scanning for delimiter.

* Minor tuning. Now below 0.80s on Intel i9-13900K.

* Add number parsing code from Quan Anh Mai. Fix name length issue.

* Include suggestion from Alfonso Peterssen for another 1.5%.

* Optimize hash collision check compare for ~4% gain.

* Add perf stats based on latest version.
2024-01-10 19:42:51 +01:00
Nils Semmelrock
a421ad5dbf Revert "Adding Nils Semmelrock's submission"
This reverts commit 12ae36ad
2024-01-10 19:33:52 +01:00
Alexander Yastrebov
a08cd0e05a Add small test cases
For https://github.com/gunnarmorling/1brc/issues/276
2024-01-10 15:48:42 +01:00
Daniel Avery
82cb32946e
Add davery22 impl 2024-01-07 21:14:04 +01:00
Jamie Stansfield
dbd8ca4562
isolgpus: submission 2 - about a 25% improvement on submission 1. (#168)
* isolgpus: fix chunk sizing when not at 8 threads
use as many cores as are available
don't buffer the station name, only use it when we need it.
get rid of the main branch
move variables inside the loop

* isolgpus: optimistically assume we can read a whole int for the station name, but roll back if we get it wrong. This should be very beneficial on a dataset where station names are mostly over 4 chars

---------

Co-authored-by: Jamie Stansfield <jalstansfield@gmail.com>
2024-01-07 20:55:30 +01:00
Thomas Wuerthinger
243388ad7b
Use SIMD for search for delimiter and name compare 2024-01-07 20:50:11 +01:00
김예환 Ye-Hwan Kim (Sam)
9e9e533401
Add yehwankim23 (#148) 2024-01-07 20:41:41 +01:00
Olivier Bourgain
143132e8df
My implementation is in dev.morling.onebrc.CalculateAverage_obourgain and runnable with provided script calculate_average_obourgain.sh (#75)
Runs with standard JDK 21.

On my computers (i5 13500, 20 cores, 32GB ram) my best run is (file fully in page cache):
49.78user 0.69system 0:02.81elapsed 1795%CPU

A bit older version of the code on Mac pro  M1 32 GB:
real	0m2.867s
user	0m23.956s
sys	0m1.329s

As I wrote in comments in the code, I have a few different roundings that the reference implementation. I have seend that there is an issue about that, but no specific rule yet.

Main points:
- use MemorySegment, it's faster than ByteBuffer
- split the work in a lot of chunks and distribute to a thread pool
- fast measurement parser by using a lot of domain knowledge
- very low allocation
- visit each byte only once

Things I tried that were in fact pessimizations:
- use some internal JDK code to vectorize the hashCode computation
- use a MemorySegment to represent the keys instead of byte[], to avoid
  copying

Hope I won't have a bad surprise when running on the target server 😱
2024-01-07 20:15:53 +01:00
Roy van Rijn
e665d71549
Roy: Adding a bit of unsafe...
Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-07 19:41:43 +01:00
ags
990483dcc8 first attempt 2024-01-07 12:09:43 +01:00
Cool_Mineman
d89d1b488d
Initial Implementation - coolmineman (#196)
* start

* slower

* still bad

* finally faster than baseline :)

* starting to go fast

* improve

* we ball

* fix race condition an newline

* change threadpool

* ~18sec on my machine
2024-01-07 11:39:45 +01:00
Kevin McMurtrie
2e1fba5a92
1brc submission - Kevin McMurtrie (#195)
* v1

* Fix sorting
2024-01-07 11:12:57 +01:00
John
96d1050a8c An implementation optimised for simplicity/readability. 2024-01-07 11:04:49 +01:00
Gunnar Morling
96efccfb49 Leaderboard update 2024-01-07 10:58:05 +01:00
Serghei Motpan
6b3027955a CalculateAverage semotpan attempt 1 2024-01-07 10:57:34 +01:00
Santanu Barua
85fa0891bc
Implements CalculateAverage_santanu.java
Execution time: 1 minute and 27.863 seconds
System specs: Apple M1, 8 cores, 16GB RAM

Co-authored-by: santanu barua <santanu@host109.private.net>
2024-01-07 10:40:18 +01:00
Keshavram Kuduwa
78b3415678
Optimised Code to use FileSegments with ByteBuffer (#184)
* Keshavram Kuduwa's Submission

* Resolves #102 and Code Optimizations

* Resolves #102 and Code Optimizations

* Optimised Code with Roy's Reference

* Fixed Tests

* Clean Up Code

---------

Co-authored-by: Keshavram Kuduwa <keshavram.kuduwa@apptware.com>
2024-01-07 10:11:56 +01:00
Elliot Barlas
c13997c9e0
Continue unrolling and inlining value parser. Make targeted use of ByteBuffer.getInt() instead of ByteBuffer.get(). Switch from GraalVM CE to GraalVM. (#201) 2024-01-07 10:05:18 +01:00
Andrew Sun
aa0395d01b
Add entry by Andrew Sun 2024-01-07 10:00:58 +01:00
Carlo
3ebc7d2b9c
Experiment from entangled90
* single thread memory mapped file reader, pool of processors

* cleanup of inner classes of MetricProcessor

* doubles are parsed without external functions, strings are lazily created from byte arrays

* remove load() MappedByteBuffer in memory

* fixed handling of newline

* fix a bug & correct locale used

* MappedByteBuffer size set to 1MB

* fixed rounding

* Do not use ArrayBlockingQueue.offer since it drops elements when queue is full

* MappedByteBuffer size = 32 MB
2024-01-07 09:50:34 +01:00
Gergely Kiss
c72a8e9769
Adding kgeri's solution (#137)
* Adding kgeri's solution

* parallelizing CalculatorAverage_kgeri

* fixing aggregation bugs, chunk size calc for small files

* removed GC logging

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>

* fix for when there's no newline at end of input

* fix for when the final record ends on the chunk boundary

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-07 09:45:30 +01:00
Dimitar Dimitrov
14918bb306
ddimtirov - supporting hash collisions, should have fixed #101
* ddimtirov - supporting hash collisions, should have fixed #101
* Make life easier for Windows user who need to use WSL to run the tests
2024-01-06 19:24:48 +01:00
Yavuz Tas
e8b2d2d7b4
Improvement in CalculateAverage_yavuztas (#162)
* improve double reading by eleminating string parsing in between, make calculations over on integer instead of double, parse into double at the end only once

* more improvements, sharing a single StringBuilder to build all toStrings, minor performance gain.

* micro optimizations on reading temperature

* a small skip for redundant traverses, micro optmization

* micro optimization, eleminate some if cases, saves 0.5 seconds more

* micro optimization, calculate key hash ahead eleminates more more loop, saves 0.5 seconds more :)

* optimize key equals and handling the case when a region is larger than max integer size

---------

Co-authored-by: Yavuz Tas <yavuz.tas@ing.com>
2024-01-06 19:09:16 +01:00
Mudit Saxena
9879ff5034
Mudit/initial attempt (#41)
* Initial version with multiple ideas

* Added virtual thread implementation based on certain task size

* Removed evaluate file

* Fixed test issues

* Added a custom input split
2024-01-06 18:54:37 +01:00
Gunnar Morling
32bef5ac96 Updating leaderboard, formatting, avoiding OOME 2024-01-06 18:20:44 +01:00
Rafael Merino García
40acde7dd5
my first try to 1BRC!
* first try

* format

* Update calculate_average_imrafaelmerino.sh

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>

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

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>

---------

Co-authored-by: Rafael Merino García <imrafaelmerino@gmail.com>
Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-06 18:18:54 +01:00
Stefan Sprenger
749d2d8f78
Add solution by flippingbits - Use SIMD for computing aggregates
* feat(flippingbits): First revision

* chore(flippingbits): Clean up output

* fix(flippingbits): Use ShortVector.SPECIES_MAX
2024-01-06 18:13:52 +01:00