C++ Exception Handling Overhead
 Share
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

 
View only
 
 
Still loading...
ABCDEFGHIJKLMNOPQRSTU
1
Code from: http://beta.stackoverflow.com/questions/43253#43292
2
3
case0: No exception thrown nor handled, compiled with no exception support disabled
4
case1: No exception thrown nor handled
5
case2: No exception thrown, but handler installed
6
case3: Exception thrown and caught
7
8
Numbers mean "microseconds required to invoke a function with one instruction that increases a global integer variable".
9
Linux and Windows results are from different machines.
10
11
Linux i386, gcc 4.1, no optimizationcase0case1case2case3
12
0.0063250.0068760.0069366.935023
13
0.0058950.0059330.0059027.329271
14
0.0058940.0068750.0068798.004844
15
0.0058940.0068780.0068788.012517
16
0.0058950.0068780.0068757.993763
17
0.0058950.0068760.0068777.987525
18
0.0058940.0068780.0068757.988493
19
0.0058940.0068780.0068778.00077
20
0.0058940.0068760.0068787.976634
21
0.0058940.0068760.0068787.997946case1 / case0case2 / case0case3 / case0
22
Average:0.00593740.00678240.00678557.8226786114.23%114.28%131752.60%
23
Variance:1.85E-088.91E-089.67E-081.27E-01
24
25
26
27
Linux i386, gcc 4.1, -O2case0case1case2case3
28
0.0058230.0070080.0069516.95892
29
0.0053390.0059560.0059546.900039
30
0.0053720.0060460.0060456.901203
31
0.0052960.0060440.0060466.912711
32
0.005350.0060460.0060486.878748
33
0.0052720.0060460.0060446.90137
34
0.0053010.0060460.0060466.896871
35
0.0053750.0060460.0060466.930416
36
0.0053140.0060440.0060466.894069
37
0.0054140.0060460.0060446.897126case1 / case0case2 / case0case3 / case0
38
Average:0.00538560.00613280.0061276.9071473113.87%113.77%128252.14%
39
Variance:2.55E-089.54E-088.47E-085.06E-04
40
41
42
43
Windows, MS Visual C++ 2008, Debugcase0case1case2case3
44
0.0945540.0965610.0973384.487306
45
0.0936690.0914150.1043494.494703
46
0.0935720.0952170.0999074.499917
47
0.0934050.096330.0962634.502074
48
0.094010.093580.100324.5072
49
0.0945440.0924010.1035794.471176
50
0.0941970.0944220.1005444.802643
51
0.0942840.0937290.1139814.50765
52
0.0932590.0985140.094214.456679
53
0.0936220.0933160.0974084.441111case1 / case0case2 / case0case3 / case0
54
Average:0.09391160.09454850.10078994.5170459100.68%107.32%4809.89%
55
Variance:2.20E-074.55E-063.14E-051.06E-02
56
57
58
59
Windows, MS Visual C++ 2008, Releasecase0case1case2case3
60
0.003640.0034710.0038093.750414
61
0.0035450.004330.0036433.666946
62
0.0037370.003930.0035933.702529
63
0.0035760.0046280.0035513.66787
64
0.0036470.0036660.003653.622509
65
0.0035970.0038350.0036873.690833
66
0.0035410.0033220.0036393.670259
67
0.0035970.0033270.0033943.689647
68
0.0037360.0036910.0036013.609614
69
0.0037060.0036940.0036023.742473case1 / case0case2 / case0case3 / case0
70
Average:0.00363220.00378940.00361693.6813094104.33%99.58%101352.06%
71
Variance:5.45E-091.76E-071.10E-082.03E-03
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Loading...
 
 
 
Sheet1