Commit Graph

213 Commits

Author SHA1 Message Date
Nick Palmer
6aa63e1bd5 Attempt nicer threading via streams and spliterators 2024-01-04 23:54:04 +01:00
Richard Startin
b2cd84c6bc make aggregation state grow dynamically 2024-01-04 23:48:54 +01:00
Alexander Yastrebov
b467319e58 test: use temperature value of 1.0
In case of key collision broken implementation will likely attribute
measurements to the wrong key and therefore it is better to have
non-zero value to end up with a wrong average value.

When all measurements are zero then averages are also zero even
when attributed to the wrong keys.

Updates #91
2024-01-04 23:46:46 +01:00
jairo
a17ab05d4b add implementation jgrateron 2024-01-04 23:43:43 +01:00
Nils Semmelrock
12ae36ade1
Adding Nils Semmelrock's submission
nothing fancy, just work on chunks in parallel and optimize bottlenecks
2024-01-04 23:31:47 +01:00
Roy van Rijn
1c74049991
Updating Roy's submission
* Added tests for endian-calculations (had these in a different class, perhaps handy for others to see as well)

Inlined the hash function, runs locally in 2.4sec now, hopefully endian issues fix

Added equals to support any city name up to 1024 in length, don't rely on hash

* For clarity I've updated the code so endian doesn't change the hashes, easier to debug.

* Fixing bug in array check

Simple is faster

* Also spotted the diff, not just the big exception

Fixed buffer limit issue
2024-01-04 23:22:48 +01:00
Moysés Borges Furtado
acb6510a02
Adding Moysés Borges Furtado's submission 2024-01-04 23:15:22 +01:00
Filip Hrisafov
e5d074651f #63 CI build should fail if formatting is incorrect 2024-01-04 21:45:24 +01:00
Gunnar Morling
d7b1f3d86d Leaderboard update 2024-01-04 21:44:32 +01:00
Alexander Yastrebov
723cc6a33b test: add sample with 10k unique keys
Input created via
```sh
bash -c 'for i in {1..10000} ; do echo "id$i;0.0" ; done' >./src/test/resources/samples/measurements-10000-unique-keys.txt
```
and output via baseline implementation.

Keys are short and very similar which improves chances for collision
and hence are good for testing.

Fixes #91
2024-01-04 21:39:04 +01:00
Gunnar Morling
e1a6832837 Adding a missing new line 2024-01-04 21:32:02 +01:00
Gunnar Morling
bbca6d952d Disabling GC logging for conformance with test runner 2024-01-04 21:22:14 +01:00
Alexander Yastrebov
8124a0ca08 test: add script to test all implementations
The script tests all implementations and prints PASS or FAIL status.
In case of failure it also prints implementation output to stderr.

This will be handy for adding new test samples.

Show test statuses and omit failing output:
```sh
$ ./test_all.sh 2>/dev/null
PASS artsiomkorzun
PASS baseline
PASS bjhara
PASS criccomini
FAIL ddimtirov
FAIL ebarlas
PASS filiphr
FAIL itaske
PASS khmarbaise
FAIL kuduwa-keshavram
FAIL lawrey
PASS padreati
FAIL palmr
PASS richardstartin
FAIL royvanrijn
FAIL seijikun
PASS spullara
PASS truelive
```

Show only passing implementations:
```
$ ./test_all.sh 2>/dev/null | grep PASS | cut -d' ' -f2
artsiomkorzun
baseline
bjhara
criccomini
filiphr
khmarbaise
padreati
richardstartin
spullara
truelive
```

For #61
2024-01-04 21:16:18 +01:00
Gunnar Morling
74a774e47d
Update README.md 2024-01-04 21:09:42 +01:00
Gunnar Morling
4f04adfe58 Leaderboard update 2024-01-04 21:06:45 +01:00
Elliot Barlas
a8bd6b58ce
Elliot Barlas: Use proper hash key collision detection scheme
* Use open-addressing scheme to deal with hash table collisions. Reduce concurrency from 16 to 8. Use bit mask rather than mod operator to confine hash code to table range.

* Properly handle file partitions that reside entirely within a line.

* Reorder statements in doProcessBuffer.
2024-01-04 21:06:19 +01:00
Gunnar Morling
0c59483985 #94 Name fix 2024-01-04 20:22:36 +01:00
Gunnar Morling
c4d2dc96a8 Leaderboard update 2024-01-04 20:01:40 +01:00
Alexander Yastrebov
4077d749e2 Fix baseline script name 2024-01-04 19:39:06 +01:00
Gunnar Morling
37350f1c8e Leaderboard update 2024-01-04 19:14:34 +01:00
Sam Pullara
4af3253d53
Updating Sam Pullara's entry 2024-01-04 19:14:06 +01:00
Gunnar Morling
c1954f6a3f Formatting 2024-01-04 19:03:42 +01:00
artsiomkorzun
9b0b10f101
Adding artsiomkorzun's solution 2024-01-04 19:01:28 +01:00
Filip Hrisafov
8c5aaf2db9 Manually compute temperature value instead of using Long.parseLong 2024-01-04 18:50:45 +01:00
Filip Hrisafov
f5f3a41045 Use a hash key for the city as a key in the map 2024-01-04 18:50:45 +01:00
Filip Hrisafov
4a483b4097 Use long parse and use char array instead of CharBuffer for adding to it 2024-01-04 18:50:45 +01:00
Gunnar Morling
88b1c30db8 Leaderboard update 2024-01-04 18:22:13 +01:00
Richard Startin
c3411f6023
Richard Startin: Adopt @spullara's double parsing code;
* increase chunk size
* simplify and tune parameters
2024-01-04 18:19:56 +01:00
Peter Lawrey
a09fa928db
Adding Peter Lawrey's submission 2024-01-04 17:59:40 +01:00
Gunnar Morling
5d885165ba Updating ignore file 2024-01-04 17:46:11 +01:00
Gunnar Morling
5c219e7b7a Fixing wrong expected value 2024-01-04 17:43:01 +01:00
Gunnar Morling
b6d33fd8fe Expanding tests and eval infra 2024-01-04 17:22:00 +01:00
Filip Hrisafov
a503362c36 Auto reformat classes 2024-01-04 15:35:34 +01:00
Filip Hrisafov
fd92f5e807 Use enable-preview via compiler argument option in the maven-compiler-plugin because IntelliJ does not recognize the configuration option 2024-01-04 15:35:34 +01:00
Gunnar Morling
5d8d91e0e8 Clarifying maximum number of distinct station names 2024-01-04 15:24:43 +01:00
Gunnar Morling
c74dc32b35 Adding test loop 2024-01-04 15:24:27 +01:00
Alexander Yastrebov
c9400bc1ce test: add test samples
Adds test samples that can be used for unit tests or to verify
implementations via:
```bash
for sample in $(ls src/test/resources/samples/*.txt)
do
  echo "Validating $sample"
  rm -f measurements.txt
  ln -s $sample measurements.txt

  diff <(./calculate_average.sh) ${sample%.txt}.out
done
rm measurements.txt
```

For #61
2024-01-04 13:18:29 +01:00
Johannes Bechberger
9a558e2451 Link async-profiler and ap-loader in the README 2024-01-04 12:38:08 +01:00
Gunnar Morling
f52a89083b
FAQ: OS clarification 2024-01-04 12:37:17 +01:00
Gunnar Morling
82eeeea693
Rule and value range clarifications 2024-01-04 12:19:31 +01:00
Gunnar Morling
5749636572
Updating leaderboard;
Removing two solutions from the leaderboard temporarily, as they violated the "must work with all station names" rule and are prone to hash collisions for names not in the current data set. Will bring them back once these submissions have been updated.
2024-01-04 09:34:45 +01:00
Gunnar Morling
09c4e603f5 Leaderboard update 2024-01-03 21:20:30 +01:00
Elliot Barlas
ba5a839a86
Running ebarlas solution with GraalVM CE 21.0.1 2024-01-03 21:18:20 +01:00
Gunnar Morling
22d5d2270f Leaderboard update 2024-01-03 21:05:14 +01:00
Dimitar Dimitrov
d73457872f ddimtirov - switched to the foreign memory access preview API for another 10% speedup 2024-01-03 21:04:44 +01:00
Dimitar Dimitrov
1923fc65a8 ddimtirov - lifted parallel mmapped i/o from Sam Pullara's implementation 2024-01-03 21:04:44 +01:00
Dimitar Dimitrov
57cfa54c68 ddimtirov - single-threaded datastructures tuning - reading to char buffers, one pass, no allocation processing 2024-01-03 21:04:44 +01:00
Dimitar Dimitrov
2458f056d6 ddimtirov - fixpoint, objects, streams and strings 2024-01-03 21:04:44 +01:00
Roy van Rijn
5570f1b60a
Roy van Rijn: memory mapped files, branchless parsing, bitwiddle magic
Added SWAR (SIMD Within A Register) code to increase bytebuffer processing/throughput
Delaying the creation of the String by comparing hash, segmenting like spullara, improved EOL finding

Co-authored-by: Gunnar Morling <gunnar.morling@googlemail.com>
2024-01-03 20:44:24 +01:00
Richard Startin
0ba5cf33d4 richardstartin submission 2024-01-03 20:42:18 +01:00