Skip to content

Commit

Permalink
Leaderboard, formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling committed Jan 11, 2024
1 parent 780ab9a commit b0c9952
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ These are the results from running all entries into the challenge on eight cores
| | 00:17.490 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_kgeri.java)| 21.0.1-open | [Gergely Kiss](https://github.com/kgeri) | |
| | 00:18.251 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_seijikun.java)| 21.0.1-graal | [Markus Ebner](https://github.com/seijikun) | |
| | 00:18.448 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_moysesb.java)| 21.0.1-open | [Moysés Borges Furtado](https://github.com/moysesb) | |
| | 00:18.583 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_davecom.java)| 21.0.1-open | [David Kopec](https://github.com/davecom) | |
| | 00:18.771 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_davecom.java)| 21.0.1-graal | [David Kopec](https://github.com/davecom) | |
| | 00:19.357 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_truelive.java)| 21.0.1-graalce | [Roman Schweitzer](https://github.com/truelive) | |
| | 00:21.989 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_couragelee.java)| 21.0.1-open | [couragelee](https://github.com/couragelee) | |
| | 00:22.457 | [link](https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_rby.java)| 21.0.1-open | [Ramzi Ben Yahya](https://github.com/rby) | |
Expand Down
2 changes: 1 addition & 1 deletion calculate_average_alesj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
# sdk use java 21.0.1-graal 1>&2

JAVA_OPTS=""
time java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar dev.morling.onebrc.CalculateAverage_alesj
java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar dev.morling.onebrc.CalculateAverage_alesj
2 changes: 1 addition & 1 deletion calculate_average_charlibot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@


JAVA_OPTS=""
time java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar dev.morling.onebrc.CalculateAverage_charlibot
java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar dev.morling.onebrc.CalculateAverage_charlibot
2 changes: 1 addition & 1 deletion calculate_average_kumarsaurav123.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

JAVA_OPTS="-Xms6G -Xmx16G"

time java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar dev.morling.onebrc.CalculateAverage_kumarsaurav123
java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar dev.morling.onebrc.CalculateAverage_kumarsaurav123
Empty file modified prepare_davecom.sh
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ private static class MeasurementAggregator {
}

public static void main(String[] args) {
HashMap<Byte,Integer> map=new HashMap<>();
map.put((byte) 48,0);
map.put((byte) 49,1);
map.put((byte) 50,2);
map.put((byte) 51,3);
map.put((byte) 52,4);
map.put((byte) 53,5);
map.put((byte) 54,6);
map.put((byte) 55,7);
map.put((byte) 56,8);
map.put((byte) 57,9);
HashMap<Byte, Integer> map = new HashMap<>();
map.put((byte) 48, 0);
map.put((byte) 49, 1);
map.put((byte) 50, 2);
map.put((byte) 51, 3);
map.put((byte) 52, 4);
map.put((byte) 53, 5);
map.put((byte) 54, 6);
map.put((byte) 55, 7);
map.put((byte) 56, 8);
map.put((byte) 57, 9);
Collector<ResultRow, MeasurementAggregator, ResultRow> collector2 = Collector.of(
MeasurementAggregator::new,
(a, m) -> {
Expand Down Expand Up @@ -146,26 +146,26 @@ public void run() {
byte[] s2 = new byte[i - st];
System.arraycopy(allBytes2, st, s2, 0, s2.length);
if (cnt != 0) {
for(int j=0;j<s2.length;j++)
{
for (int j = 0; j < s2.length; j++) {
if (s2[j] == sep[0]) {
byte[] city = new byte[j];
byte[] value = new byte[s2.length-j-1];
byte[] value = new byte[s2.length - j - 1];
System.arraycopy(s2, 0, city, 0, city.length);
System.arraycopy(s2, city.length+1, value,0, value.length);
double d=0.0;
int s=-1;
for(int k=value.length-1;k>=0;k--) {
System.arraycopy(s2, city.length + 1, value, 0, value.length);
double d = 0.0;
int s = -1;
for (int k = value.length - 1; k >= 0; k--) {
if (value[k] == 45) {
d=d*-1;
d = d * -1;
}
else if (value[k] == 46) {
} else {
}
else {
d = d + map.get(value[k]).intValue() * Math.pow(10, s);
s++;
}
}
mst.add(new Measurement(new String(city),d));
mst.add(new Measurement(new String(city), d));

}
}
Expand All @@ -190,7 +190,7 @@ else if (value[k] == 46) {
measurements.addAll(mst.stream()
.collect(groupingBy(Measurement::station, collector))
.values());
// System.out.println(measurements.size());
// System.out.println(measurements.size());
}
catch (Exception e) {
// throw new RuntimeException(e);
Expand Down Expand Up @@ -251,6 +251,6 @@ else if (value[k] == 46) {
// .collect(groupingBy(m -> m.station(), collector)));

System.out.println(measurements2);
// System.out.println(System.currentTimeMillis() - start);
// System.out.println(System.currentTimeMillis() - start);
}
}

0 comments on commit b0c9952

Please sign in to comment.