Commit 8b67405
committed
Uses
Tests on MacBook Pro 2018 (2,3 GHz Quad-Core Intel Core i5, RAM LPDDR3) show for array of random 100_000 elements:
* original implementation 0.410 sec
* proposed implementation 0.048 sec
* also tried `lazy.map{ String(format: "%02x", $0) }.joined()` which takes 0.232 secreduce(into:,_) instead of reduce(_,_) which gives an order of magnitude performance gain.1 parent e699ada commit 8b67405
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments