Commit Graph

491 Commits

Author SHA1 Message Date
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
Gunnar Morling
f5c9750611 Leaderboard update 2024-01-19 17:21:37 +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
Gunnar Morling
673c1b9f6e Leaderboard update 2024-01-17 22:00:38 +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
Gunnar Morling
1bbddaaaf6 Leaderboard update 2024-01-16 22:55:16 +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
Gunnar Morling
f8874c3886 Leaderboard update 2024-01-15 21:21:38 +01:00
Artsiom Korzun
073d3aecdf
native version (#434) 2024-01-15 21:07:53 +01:00
Gunnar Morling
116f623f3e Leaderboard update 2024-01-15 21:07:30 +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
Gunnar Morling
6df2863cfc Leaderboard update 2024-01-15 20:43:50 +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
Gunnar Morling
dd9a3dde7e
Update pull_request_template.md 2024-01-15 20:12:31 +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
Gunnar Morling
ca075b66f2 Leaderboard update 2024-01-15 19:04:29 +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