Posted At : September 14, 2006 9:10 PM
This works well for the main application where performance is the critical measure, however it is not very flexible when it comes to creating an admin application that used the same core libraries but where having each component cached in the application is wasteful of resource.
I'm currently exploring to see if it's possible to get the best of both worlds:
To discover the what the overhead of instantiating a component is I ran the following tests.
| Large component (45 functions) | T1 | T2 | T3 | Average |
|---|---|---|---|---|
| Create component each time | 17438 | 11766 | 12010 | 13738 |
| Re use component | 6952 | 7240 | 8440 | 7544 |
| Small component (1 functions) | T1 | T2 | T3 | Average | Create component each time | 9059 | 9557 | 8644 | 9087 |
| Re use component | 5950 | 7238 | 5873 | 6354 |
For a large component up to 45% of the time was spent creating instances
For the small component 30% of the time was spent creating instances
What this shows is that it is definitely worth minimising component instantiation in performance critical applications, as between 30 - 45% of time could be spend instantiating the component (if it not reused).
Stay tuned for a solution to instantiating and caching components.
0 Comments