It should be noted that the aim of this testing was not to be an exhaustive test of the relative performance of each approach but to simply get an order of magnitude comparison between the two options.
The test comprises of a host that exposes two services:
- EntLibValidationService – A service that is configured with Enterprise Library WCF validation
- ManualValidationService – A service that is performing manual validation
- A null argument passed to a service request
- A property of a request object out of range
- A request containing a list of objects
- A request containing a list of derived request objects
Processor: Intel(R) Xeon(R) CPU E5606 @ 2.13GHz (4 CPUs), ~2.1GHz
Memory: 3072MB RAM
Test Case
|
Run 1
|
Run 2
|
Run 3
|
Average
| |
EntLIb |
1
|
7.6 ms
|
7.7 ms
| 7.7 ms |
7.6 ms
|
2
|
7.5 ms
|
7.7 ms
| 7.7 ms |
7.6 ms
| |
3
|
9.1 ms
|
9.4 ms
| 9.7 ms |
9.4 ms
| |
4
|
9.8 ms
|
10 ms
| 10 ms |
9.9 ms
| |
Manual |
1
|
9.6 ms
|
9.8 ms
| 9.7 ms |
9.7 ms
|
2
|
9.2 ms
|
9.5 ms
| 9.5 ms |
9.4 ms
| |
3
|
9.3 ms
|
9.5 ms
| 9.5 ms |
9.4 ms
| |
4
|
9.9 ms
|
9.9 ms
| 9.8 ms |
9.8 ms
|
From the above results it can be seen that there is not much overhead in using the Enterprise Library for WCF request validation. In the case of argument or property validation, Case 1 and Case 2, it can be seen that it actually performs better than manual validation.
For test Case 3 and 4 the numbers do not reflect an accurate comparison of manual validation due to the fact that the Enterprise Library validator performs validation on all of the objects in the collection for each call therefore it has actually performed better than the manual validation.
I suspect that most of the overhead of the request’s are serialising and de serialising the faults generated from both validation mechanisms.
No comments:
Post a Comment