-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimes.txt
36 lines (29 loc) · 880 Bytes
/
times.txt
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
s_1 - stdlib hashmap
real 5m38.348s
user 5m28.129s
sys 0m6.525s
s_2 - int math
real 3m47.678s
user 3m40.952s
sys 0m5.362s
s_2.1 better itoc and ctoi + inline
real 3m14.754s
user 3m7.526s
sys 0m5.771s
s_3 branch avoidance
real 1m32.719s
user 1m25.706s
sys 0m5.805s
ANOMALY:
avoiding branching in int_to_char and char_to_int helped a lot.
avoiding branching in padding function didn't help at all. Must investigate.
Distribution:
count: 1000000000
negative: 87780411 -> 8.8% // ex. -99
point1: 178191570 -> 17.8% // ex. 9.9
point2: 801638107 -> 80.1% // ex. 99.9
no point1 0 // ex. 9
no point2 20170323 -> 2.0% // ex. 99
Thesis: having a shorter calculation for 80% of the time migth be worth the
occasional pipeline flush. -> Goal should be to optimize for point2 case.
Branch prediction should do the rest. __builtin_expect?