AOP BenchmarkXML:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
1、性能测试的AOP或代理框架
(1)字节码框架
l ASPectWerkz 1.0
l ASPectWerkz 2.x
l ASPectJ 1.2
l JBoss AOP 1.0
(2)代理框架
l Spring AOP 1.1.1
l cglib proxy 2.0.2
l dynaop 1.0beta
(3)ASPectWerkz可扩展ASPect容器
l ASPectJ
l AOP Alliance
l Spring AOP
2、性能测试结果
AWBench (ns/invocation)
ASPect
Werkz2.x
awproxy
Werkz1.0
ASPectj
jboss
spring
dynaop
cglib
ext:
aopalliance
before, args() target()
10
25
606
220
355
390
145
-
around x 2, args() target()
80
85
651
50
290
436
455
155
465
476
before
15
20
520
275
320
70
40
before, static info Access
30
501
175
330
35
before, rtti info Access
55
535
335
75
after returning
541
135
285
315
45
after throwing
3540
3870
6103
3009
5032
6709
8127
3460
before + after
511
160
445
345
before, args() primitives
555
195
350
375
210
before, args() objects
5
546
185
325
115
200
around
60
95
470
225
90
around, rtti info Access
140
250
340
around, static info Access
486
245
下面的表格以ASPectWerkz 2.0.RC2-snapshot 作为参考标准:
AWBench (relative %)
werkz1.0
1 x
2.5 x
60.6 x
22 x
35.5 x
39 x
14.5 x
8.1 x
0.6 x
3.6 x
5.4 x
5.6 x
1.9 x
5.8 x
5.9 x