-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample-run-java8.txt
More file actions
33 lines (29 loc) · 2.52 KB
/
Copy pathexample-run-java8.txt
File metadata and controls
33 lines (29 loc) · 2.52 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
Running with:
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
Generated input (length: 22000000) in 285 ms.
Contender | Length | Hash | Timems | Notes
------------------------------------------------------------------------------------------------------------
(#1) Edwin-1, Map and Stream to StringBuilder | 22000000 | -589829313 | 422ms |
(#2) Edwin-2, Map and For to StringBuilder | 22000000 | -589829313 | 431ms |
(#3) Edwin-3, Map and For to StringBuffer | 22000000 | -589829313 | 422ms |
(#4) Edwin-4, Parallel stream version | 22000000 | -589829313 | 533ms |
(#5) Thijs-1, simple replace + to-upper | 22000000 | -589829313 | 130ms |
(#6) Thijs-2, For with if/else to StringBuilder | 22000000 | -589829313 | 198ms |
(#7) Thijs-3, For with switch/case to StringBuilder | 22000000 | -589829313 | 214ms |
(#8) Thijs-4, For with if/else to byte array | 22000000 | -589829313 | 149ms |
(#9) Armand-1, replace with look-ahead regex. | -1 | -1 | 0ms | Length mismatch. Hash-code mismatch.
(#10) Jan-1, dirty :) | 22000000 | -589829313 | 142ms |
(#11) Jan-2, simple replace + no-upper | 22000000 | -589829313 | 117ms |
(#12) Milo-1, parallel string replace | 22000000 | -589829313 | 105ms |
(#13) Jan-3, Milo-1 + Jan-2, parallel string replace | 22000000 | -589829313 | 105ms |
(#14) Jan-4, ForkJoinPool | 22000000 | -589829313 | 92ms |
(#15) Milo-3, parallel char replace | 22000000 | -589829313 | 43ms |
(#16) Jan-5, ForkJoinPool (direct write) | 22000000 | -589829313 | 51ms |
(#17) Milo-4, parallel char replace with direct access in String | 22000000 | -589829313 | 37ms | Code did update immutable input string!
(#18) Thijs-5, simple replace + to-upper (half of them to-upper) | 22000000 | -589829313 | 227ms |
(#19) Dylan-1, simple recursive impl. | 22000000 | -589829313 | 874ms |
CPU info (available if on linux)
bogomips : 5786.46
model name : Intel(R) Core(TM) i7-4910MQ CPU @ 2.90GHz