Skip to content

hengyunabc/spring-mvc-showcase-for-benchmark

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring MVC path variable and parameter variable benchmark.

Add these @RequestMapping:

	@RequestMapping("/paravar")
	@ResponseBody
	public String path(String var) throws InterruptedException{
//		TimeUnit.MILLISECONDS.sleep(1);
		return var;
	}

	@RequestMapping("/pathvar/{var}")
	@ResponseBody
	public String path(@PathVariable String var) throws InterruptedException{
//		TimeUnit.MILLISECONDS.sleep(1);
		return var;
	}

start tomcat

mvn tomcat7:run -DskipTests

benchamrk:

ab -n 10000 -c 50 http://localhost:8080/spring-mvc-showcase/paravar?var=abc
ab -n 10000 -c 50 http://localhost:8080/spring-mvc-showcase/pathvar/abc

result:

Document Path:          /spring-mvc-showcase/paravar?var=abc
Requests per second:    8608.68 [#/sec] (mean)
Document Path:          /spring-mvc-showcase/pathvar/abc
Requests per second:    4637.04 [#/sec] (mean)

About

Demonstrates the features of the Spring MVC web framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 73.2%
  • JavaScript 25.4%
  • CSS 1.4%