In this post, I revisit the loading requests in Google App Engine for Java. The test results are shown below. The following modes are:
- Skeleton
- Plain-vanilla skeleton webapp with SDK (1.8.2) dependencies.
- With Spring Framework Web
- Skeleton webapp plus Spring Framework Web (3.2.4.RELEASE) dependencies. This adds almost
3 MB
of JARs.spring-aop-3.2.4.RELEASE.jar 335455 spring-beans-3.2.4.RELEASE.jar 607755 spring-context-3.2.4.RELEASE.jar 863688 spring-core-3.2.4.RELEASE.jar 869674 spring-expression-3.2.4.RELEASE.jar 196807 spring-web-3.2.4.RELEASE.jar 625875 - With Spring Web MVC
- Webapp with Spring Framework Web MVC. This add one additonal JAR.
spring-webmvc-3.2.4.RELEASE.jar 636993 - With Spring Web MVC and applicationContext
- Webapp with Spring Framework Web MVC and running an empty (zero beans) application context on startup via ContextLoaderListener.
- With Google Guice
- Skeleton webapp with Google Guice (3.0) dependencies.
- With Google Guice (one servlet module)
- Webapp with Google Guice servlet context listener, filter, loading a servlet module.
- With Google Guice (one servlet module)
- Same as before, but built without AOP. The following dependency declaration was used:
<dependency> <groupId>com.google.inject</groupId> <artifactId>guice</artifactId> <version>${guice.version}</version> <classifier>no_aop</classifier> <exclusions> <exclusion> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.google.inject.extensions</groupId> <artifactId>guice-servlet</artifactId> <version>${guice.version}</version> <exclusions> <exclusion> <groupId>com.google.inject</groupId> <artifactId>guice</artifactId> </exclusion> </exclusions> </dependency>
Test Results (Summarized)
Times are measured by shutting down instance, hitting a URL, looking at request time in logs. All using a frontend instance class of F1 (600MHz, 128MB).
Mode | Average Time (ms) |
---|---|
Skeleton | 4322.6 |
With Spring Web | 4836.0 |
With Spring Web MVC | 4819.0 |
With Spring Web MVC and applicationContext | 8845.6 |
With Google Guice (no modules) | 4437.6 |
With Google Guice (one servlet module) | 8260.8 |
With Google Guice (one servlet module, no AOP) | 5332.2 |
Observations
- Adding some JARs (dependencies) to the web application (even without using any of its classes) increases the time it takes to complete a loading request.
- Adding an empty (zero beans) application context to the web application increases the time by about 4 seconds.
- Using Google Guice to load servlets and provide dependency injection can add about 4 seconds (similar to using Spring Framework).
- Removing AOP from the use of Google Guice can lower the additional loading request time.
Test Results (Raw)
Mode | Try | Time (ms) |
---|---|---|
Skeleton | 1 | 4050 |
Skeleton | 2 | 4384 |
Skeleton | 3 | 4305 |
Skeleton | 4 | 4609 |
Skeleton | 5 | 4265 |
Skeleton | Average | 4322.6 |
With Spring Web | 1 | 5001 |
With Spring Web | 2 | 5115 |
With Spring Web | 3 | 4783 |
With Spring Web | 4 | 4724 |
With Spring Web | 5 | 4557 |
With Spring Web | Average | 4836.0 |
With Spring Web MVC | 1 | 5205 |
With Spring Web MVC | 2 | 4900 |
With Spring Web MVC | 3 | 4486 |
With Spring Web MVC | 4 | 5164 |
With Spring Web MVC | 5 | 4340 |
With Spring Web MVC | Average | 4819.0 |
With Spring Web MVC and applicationContext | 1 | 9187 |
With Spring Web MVC and applicationContext | 2 | 8946 |
With Spring Web MVC and applicationContext | 3 | 8417 |
With Spring Web MVC and applicationContext | 4 | 8777 |
With Spring Web MVC and applicationContext | 5 | 8901 |
With Spring Web MVC and applicationContext | Average | 8845.6 |
With Google Guice (no modules) | 1 | 4578 |
With Google Guice (no modules) | 2 | 4473 |
With Google Guice (no modules) | 3 | 4480 |
With Google Guice (no modules) | 4 | 4223 |
With Google Guice (no modules) | 5 | 4434 |
With Google Guice (no modules) | Average | 4437.6 |
With Google Guice (one servlet module) | 1 | 7845 |
With Google Guice (one servlet module) | 2 | 8426 |
With Google Guice (one servlet module) | 3 | 8476 |
With Google Guice (one servlet module) | 4 | 8394 |
With Google Guice (one servlet module) | 5 | 8163 |
With Google Guice (one servlet module) | Average | 8260.8 |
With Google Guice (one servlet module, no AOP) | 1 | 5702 |
With Google Guice (one servlet module, no AOP) | 2 | 5020 |
With Google Guice (one servlet module, no AOP) | 3 | 6036 |
With Google Guice (one servlet module, no AOP) | 4 | 5223 |
With Google Guice (one servlet module, no AOP) | 5 | 4680 |
With Google Guice (one servlet module, no AOP) | Average | 5332.2 |
No comments:
Post a Comment