-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample-run-java9.txt
More file actions
40 lines (36 loc) · 3.05 KB
/
Copy pathexample-run-java9.txt
File metadata and controls
40 lines (36 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Note: Contest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Running with:
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
Generated input (length: 22000000) in 263 ms.
Contender | Length | Hash | Timems | Notes
------------------------------------------------------------------------------------------------------------
(#1) Edwin-1, Map and Stream to StringBuilder | 22000000 | -651788880 | 486ms |
(#2) Edwin-2, Map and For to StringBuilder | 22000000 | -651788880 | 484ms |
(#3) Edwin-3, Map and For to StringBuffer | 22000000 | -651788880 | 469ms |
(#4) Edwin-4, Parallel stream version | 22000000 | -651788880 | 598ms |
(#5) Thijs-1, simple replace + to-upper | 22000000 | -651788880 | 238ms |
(#6) Thijs-2, For with if/else to StringBuilder | 22000000 | -651788880 | 216ms |
(#7) Thijs-3, For with switch/case to StringBuilder | 22000000 | -651788880 | 226ms |
(#8) Thijs-4, For with if/else to byte array | 22000000 | -651788880 | 150ms |
(#9) Armand-1, replace with look-ahead regex. | -1 | -1 | 0ms | Length mismatch. Hash-code mismatch.
(#10) Jan-1, dirty :) | 22000000 | -651788880 | 165ms |
(#11) Jan-2, simple replace + no-upper | 22000000 | -651788880 | 314ms |
(#12) Milo-1, parallel string replace | 22000000 | -651788880 | 104ms |
(#13) Jan-3, Milo-1 + Jan-2, parallel string replace | 22000000 | -651788880 | 145ms |
(#14) Jan-4, ForkJoinPool | 22000000 | -651788880 | 53ms |
(#15) Milo-3, parallel char replace | 22000000 | -651788880 | 43ms |
(#16) Jan-5, ForkJoinPool (direct write) | 22000000 | -651788880 | 50ms |
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by Contest$17 (file:/home/thijs/src/contest-java-character-replacer/) to field java.lang.String.value
WARNING: Please consider reporting this to the maintainers of Contest$17
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
(#17) Milo-4, parallel char replace with direct access in String | 22000000 | -651788880 | 39ms | Code did update immutable input string!
(#18) Thijs-5, simple replace + to-upper (half of them to-upper) | 22000000 | -651788880 | 344ms |
(#19) Dylan-1, simple recursive impl. | 22000000 | -651788880 | 567ms |
CPU info (available if on linux)
bogomips : 5786.46
model name : Intel(R) Core(TM) i7-4910MQ CPU @ 2.90GHz