AOP Benchmark
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 |
Aspect Werkz1.0 |
aspectj |
jboss |
spring |
dynaop |
cglib |
ext: aopalliance |
ext: spring |
ext: aspectj |
before, args() target() |
10 |
25 |
606 |
10 |
220 |
355 |
390 |
145 |
- |
220 |
- |
around x 2, args() target() |
80 |
85 |
651 |
50 |
290 |
436 |
455 |
155 |
465 |
476 |
- |
before |
15 |
20 |
520 |
15 |
145 |
275 |
320 |
70 |
- |
40 |
10 |
before, static info access |
30 |
30 |
501 |
25 |
175 |
275 |
330 |
70 |
|
35 |
|
before, rtti info access |
50 |
55 |
535 |
50 |
175 |
275 |
335 |
75 |
|
35 |
|
after returning |
10 |
20 |
541 |
10 |
135 |
285 |
315 |
85 |
- |
45 |
15 |
after throwing |
3540 |
3870 |
6103 |
3009 |
5032 |
|
6709 |
8127 |
|
- |
3460 |
before + after |
20 |
30 |
511 |
20 |
160 |
445 |
345 |
80 |
- |
35 |
20 |
before, args() primitives |
10 |
20 |
|