JSP表达式和EL用时比较

阅读更多
/city request.getContextPath() 表达式 用时 7543
/city application.getContextPath() 表达式 用时 7263
/city application.getAttribute() 表达式 用时 4191
/city ${this_context_path} EL 用时 69841
/city ${applicationScope.this_context_path} EL 用时 26819

结论:
  • request,application方法调用用时差不多
  • 表达式语言用时差不多是脚本语言的6-10倍(条件相同,即都是第一次调用或多次情况)
  • application和applicationScope第一次调用耗时较大,以后较小,最后两个的用时差不多,只是顺序不同而相差很大。

你可能感兴趣的:(JSP,脚本)