Commit Graph

309 Commits

Author SHA1 Message Date
Roman Romanchuk
594f6c4e5f
Lazy strings init, custom station map (#336) 2024-01-12 09:52:32 +01:00
Yavuz Tas
10f425e2b6
I optimized my solution: (#337)
- Eliminate redundant object creations in between
 - Custom HashMap on purpose - Inspired by @spullara
 - More performant temperature parsing - Inspired by @yemreinci
 - JVM tweaks, decreased heap memory, and remove AlwaysPreTouch

Co-authored-by: Yavuz Tas <yavuz.tas@ing.com>
2024-01-12 09:47:31 +01:00
Parth Mudgal
f37b304fc3
inline hash calculation and number parsing (#200)
no number parsing with precalculated map
verify tests
better loop with direct hash to measurement mapping
accept formatting changes
Use unsafe
2024-01-12 09:38:09 +01:00
Bang NGUYEN
af1946fcb5
[Attempt 1] Memory mapping + split by linebreak + multithreads + fast double parser (#330)
* Create clones

* Cleanup code and add memory mapping to read file

* Fix chunks reading logic to fit linebreak

* Remove unused

* Sequential

* Multi thread process chunks

* Add new line in output

* Remove unnecessary operation with map & reducer memory

* Reduce mem usage by using only 1 map

* formatting

* Remove unnecessary length check

* Remove trycatch

* Optimize double parsing
2024-01-12 09:35:35 +01:00
Gunnar Morling
3c465cecf9 Leaderboard, class name 2024-01-12 09:21:29 +01:00
Stanley Lim
a4d1c46d45
📒 docs(README.md): Fix link to baseline code (#344)
* 📒 docs(README.md): Fix link to baseline code

* Update README.md

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-12 09:20:27 +01:00
Richard Startin
37a50cb2af
update richardstartin submission (#325) 2024-01-12 09:06:09 +01:00
Jason Nochlin
6181996678
hundredwatt - 2nd submission (#338)
* check full hash before comparing

* implement merykitty suggestions to simplify temperature masking; required refactoring to little-endian

* standalone script for offline Perfect Hash seed searching

* stop using an oversized hash table

---------

Co-authored-by: Jason Nochlin <hundredwatt@users.noreply.github.com>
2024-01-12 09:03:31 +01:00
Alexander Yastrebov
80c5c2eb3e
Use bash in prepare scripts (#339)
Prepare scripts that use `#!/bin/sh` and
`source "$HOME/.sdkman/bin/sdkman-init.sh"`
fail on systems where `sh` is not `bash`,
e.g. on Ubuntu it is `dash` which has not `source`.
2024-01-12 08:25:43 +01:00
Gunnar Morling
3127962ce2
Update pull_request_template.md 2024-01-11 22:53:23 +01:00
Gunnar Morling
bf2b553d9c Formatting 2024-01-11 22:16:01 +01:00
Gunnar Morling
feee2420b8 Leaderboard update 2024-01-11 22:15:07 +01:00
Ricardo Pieper
263b272028
First attempt from ricardopieper, class CalculateAverage_ricardopieper (#306)
* My entry

* Added scripts

* Fix for unicode chars

* Formatting

* Clarifying comment

* Perf improvements

* Fixing bugs

* Fixing tests

* Deleted second file

* Added license

* Cleanup and windows support
2024-01-11 22:14:13 +01:00
Jaroslav Bachorik
ce6abf9740
Submission @jbachorik (#153)
* Submission @jbachorik

* Submission @jbachorik (take 2)

* Fix test failure

* Submission @jbachorik (take 2)

* Submission @jbachorik (take 2)
part 2

* Second reincarnation

* Launcher tweaks

* Rebase and fix new tests
2024-01-11 22:03:44 +01:00
Xylitol
7c79f235d2
Initial implementation by xylitol (#318) 2024-01-11 21:57:23 +01:00
zerninv
0e420f99e2
use custom container (#305) 2024-01-11 21:53:51 +01:00
Gunnar Morling
5c23f6f224 Leaderboard update 2024-01-11 21:49:58 +01:00
parkertimmins
bd2f7f7a53
First deployed version for parkertimmins (#322)
Version notes:
        - simd search with overlapping words, at most one entry/semicolon parsed per simd word
        - branchless temperature parsing
2024-01-11 21:46:08 +01:00
Gunnar Morling
8c13ce6595 Leaderboard update 2024-01-11 21:39:13 +01:00
Roy van Rijn
4d0586142c
Adding delayed string creation again for (no-) gc, small tweaks (#315) 2024-01-11 21:38:06 +01:00
Jason Nochlin
9f8f8b1985
create_fork.sh: Script to Create a New Fork (#296)
* Script to Create a New Fork

* validate fork name

* use interactive prompt to prevent accidentally overwriting existing fork

* recommend create_fork.sh in the README

* remove mention of additional_builds_steps (obsolete)

---------

Co-authored-by: Jason Nochlin <hundredwatt@users.noreply.github.com>
2024-01-11 21:24:03 +01:00
Jairo Graterón
20e52aaadf
Divide the reading of the file by parts (#254)
* divide the reading of the file by parts

* fix format

* add number of core partition

* fix format

* implement strToDouble

* fix strtodouble

* add locale, fix read file, tests pass

* delete unnecessary method clean
2024-01-11 21:22:58 +01:00
Anthony Goubard
11a740c5d0
One HashMap per thread: 23" to 18" locally but hopefully more on the server (#319) 2024-01-11 21:11:08 +01:00
Artsiom Korzun
8ef8cd2b17
improved artsiomkorzun solution (#321) 2024-01-11 21:08:15 +01:00
Keshavram Kuduwa
1a82c77026
Optimised Code and Fixed Tests (#314)
Co-authored-by: Keshavram Kuduwa <keshavram.kuduwa@apptware.com>
2024-01-11 21:04:50 +01:00
Hallvard Trætteberg
7b4ad1a723
Uses MappedByteBuffer for io, trie instead of map and parallelStream (#234)
* Uses MappedByteBuffer for io, trie instead of map and parallelStream

* Added license
2024-01-11 20:58:42 +01:00
Eve
4b870e6fcb
djb2 single threaded implementation (#308) 2024-01-11 20:50:51 +01:00
Samuel Yvon
56b2a6b53b
First Version (#292)
* First Version

First draft; stole chunking but it's bad

Forgot my changes

No regex building

Clean & optim

I was not benchmarking myself T_T

Faaaster

First Version

* Update calculate_average_samuelyvon.sh

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

* Add prepare script

* Fix rounding

* Fix format

* Fixing casing

* Formats of sorts?

* Rename

---------

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-11 20:37:08 +01:00
Marko Topolnik
95459f5640
Entry into the contest, calculate_average_mtopolnik.sh (#246)
* calculate_average_mtopolnik

* short hash (just first 8 bytes of name)

* Remove unneeded checks

* Remove archiving classes

* 2x larger hashtable

* Add "set" to setters

* Simplify parsing temperature, remove newline search

* Reduce the size of the name slot

* Store name length and use to detect collision

* Reduce memory loads in parseTemperature

* Use short for min/max

* Extract constant for semicolon

* Fix script header

* Explicit bash shell in shebang

* Inline usage of broadcast semicolon

* Try vectorization

* Remove vectorization

* Go Unsafe

* Use SWAR temperature parsing by merykitty

* Inline some things

* Remove commented-out MemorySegment usage

* Inline namesMem.asSlice() invocation

* Try out JVM JIT flags

* Implement strcmp

* Remove unused instance variables

* Optimize hashing

* Put station name into hashtable

* Reorder method

* Remove usage of MemorySegment.getUtf8String

Replace with UNSAFE.copyMemory() and new String()

* Fix hashing bug

* Remove outdated comments

* Fix informative constants

* Use broadcastByte() more

* Improve method naming

* More hashing

* Revert more hashing

* Add commented-out code to hash 16 bytes

* Slight cleanup

* Align hashtable at cacheline boundary

* Add Graal Native image

* Revert Graal Native image

This reverts commit d916a42326d89bd1a841bbbecfae185adb8679d7.

* Simplify shell script (no SDK selection)

* Move a constant, zero out hashtable on start

* Better name comparison

* Add prepare_mtopolnik.sh

* Cleaner idiom in name comparison

* AND instead of MOD for hashtable indexing

* Improve word masking code

* Fix formatting

* Reduce memory loads

* Remove endianness checks

* Avoid hash == 0 problem

* Fix subtle bug

* MergeSort of parellel results

* Touch up perf

* Touch up perf

* Remove -Xmx256m

* Extract result printing method

* Print allocation details on OOME

* Single mmap

* Use global allocation arena
2024-01-11 20:02:14 +01:00
Jamal Mulla
8ec9ba861a
First submission - CalculateAverage_JamalMulla.java - Jamal Mulla (#238)
* Initial chunked impl

* Bytes instead of chars

* Improved number parsing

* Custom hashmap

* Graal and some tuning

* Fix segmenting

* Fix casing

* Unsafe

* Inlining hash calc

* Improved loop

* Cleanup

* Speeding up equals

* Simplifying hash

* Replace concurrenthashmap with lock

* Small changes

* Script reorg

---------

Co-authored-by: Jamal Mulla <j.mulla@mwam.com>
2024-01-11 19:56:29 +01:00
Roman Romanchuk
6381aefcc1 Fixed failing tests 2024-01-11 19:49:51 +01:00
Alexander Yastrebov
6761d784a2 test_all.sh: configure fork test timeout
Example output:
```
$ ./test_all.sh 2>/dev/null
PASS abfrmblr
PASS AbstractKamen
PASS ags313
PASS alesj
PASS algirdasrascius
PASS anandmattikopp
PASS arjenvaneerde
FAIL armandino
TIME artpar
PASS artsiomkorzun
PASS asun
PASS baseline
PASS berry120
PASS bjhara
PASS charlibot
PASS coolmineman
PASS couragelee
PASS criccomini
PASS davecom
PASS davery22
PASS ddimtirov
PASS deemkeen
PASS ebarlas
PASS entangled90
FAIL fatroom
PASS felix19350
PASS filiphr
PASS flippingbits
PASS fragmede
PASS gabrielreid
PASS gamlerhart
PASS gnmathur
PASS hchiorean
FAIL hundredwatt
PASS imrafaelmerino
PASS isolgpus
PASS itaske
PASS iziamos
PASS japplis
PASS jgrateron
PASS jotschi
PASS kevinmcmurtrie
PASS kgeri
PASS khmarbaise
PASS kuduwa-keshavram
PASS kumarsaurav123
FAIL lawrey
PASS maeda6uiui
PASS MeanderingProgrammer
PASS merykitty
FAIL moysesb
PASS mudit-saxena
PASS obourgain
PASS padreati
PASS palmr
PASS pedestrianlove
PASS phd3
PASS raipc
PASS rby
PASS richardstartin
FAIL roman-r-m
PASS royvanrijn
PASS rprabhu
PASS santanu
PASS seijikun
PASS semotpan
PASS spullara
PASS thomaswue
PASS truelive
FAIL twobiers
PASS Ujjwalbharti
PASS yavuztas
PASS yehwankim23
FAIL yemreinci
PASS zerninv
```
2024-01-11 19:07:59 +01:00
Gunnar Morling
3144c9c595
Update README.md 2024-01-11 16:35:20 +01:00
parkertimmins
e0241f4829 Update README - newline not allowed in station names
Per https://github.com/gunnarmorling/1brc/discussions/311 station names
will not contain newline characters.
2024-01-11 16:32:01 +01:00
Gunnar Morling
8d2043e01b Leaderboard 2024-01-11 12:52:32 +01:00
Roman Musin
4b3f959812
First version - roman_r_m (#193)
* initial commit

* - use loop
- use mutable object to store results

* get rid of regex

* Do not allocate measurement objects

* MMap + custom double parsing ~ 1:30 (down from ~ 2:05)

* HashMap for accumulation and only sort at the end - 1:05

* MMap the whole file

* Use graal

* no GC

* Store results in an array list to avoid double map lookup

* Adjust max buf size

* Manual parsing number to long

* Add --enable-preview

* remove buffer size check (has no effect on performance)

* fix min & max initialization

* do not check for \r

* Revert "do not check for \r"

This reverts commit 9da1f574bf6261ea49c353488d3b4673cad3ce6e.

* Optimise parsing. Now completes in 31 sec down from ~43

* trying to parse numbers faster

* use open address hash table instead of the standard HashMap

* formatting

* Rename the script to match github username (change underscores to slashes)
Enable transparent huge pages, seems to improve by ~2 sec

* Revert "formatting"

This reverts commit 4e90797d2a729ed7385c9000c85cc7e87d935f96.

* Revert "use open address hash table instead of the standard HashMap"

This reverts commit c784b55f61e48f548b2623e5c8958c9b283cae14.

* add prepare_roman-r-m.sh

* SWAR tricks to find semicolon (-2 seconds ro run time)

* remove time call

* fix test

* Parallel version (~6.5 seconds)
2024-01-11 12:29:08 +01:00
Wladimir Schmidt
52c490cc24
Add multithreaded generation of measurements file with Gaussian distribution (M2 AIR took 24 seconds for 1B items) (#175)
* Add multithreaded variant to generate measurements

* Add removing existing measurements.txt file in case exists (for usability reasons)
Fix bug for number of lines generated

* Fix also for less than assumed chunk size (10M entries) per thread
2024-01-11 12:16:30 +01:00
MeanderingProgrammer
7ca2aa8d1d First attempt from MeanderingProgrammer
#### Check List:

- [x] Tests pass (`./test.sh MeanderingProgrammer` shows no differences between expected and actual outputs)
- [x] All formatting changes by the build are committed
- [x] Your launch script is named `calculate_average_MeanderingProgrammer.sh` (make sure to match casing of your GH user name) and is executable
- [x] Output matches that of `calculate_average_baseline.sh`

* Execution time: `00:04.668`
* Execution time of reference implementation: `02:40.597`
* System: Apple M2 Max, 12 cores, 64 GB
2024-01-11 12:03:29 +01:00
Roman Stoffel
64a78c3880 Basic Implementation with Memory Mapped File, SIMD Search
By gamlerhart
2024-01-11 11:58:57 +01:00
Jason Nochlin
80328e4898
create fork hundredwatt (#279)
Co-authored-by: Jason Nochlin <hundredwatt@users.noreply.github.com>
2024-01-11 11:48:22 +01:00
maeda6uiui
b0d381c91e Add code by maeda6uiui 2024-01-11 11:32:30 +01:00
Gunnar Morling
fe5179cc79 Leaderboard 2024-01-11 11:12:49 +01:00
Roy van Rijn
8c24871406
Fixing the off-by-one error and updating to native, redone layout of code. (#307) 2024-01-11 11:12:05 +01:00
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
Gunnar Morling
999a4e9e10 Leaderboard 2024-01-11 10:04:01 +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
Gunnar Morling
4a5eda70fd Logging 2024-01-11 09:31:36 +01:00