当前位置:主页 > java教程 > 浅谈Java模板引擎性能对比

介绍Java模板引擎性能对比

发布:2020-01-27 13:05:43 106


为网友们分享了Java相关的编程文章,网友冷元化根据主题投稿了本篇教程内容,涉及到Java、模板引擎、浅谈Java模板引擎性能对比相关内容,已被636网友关注,下面的电子资料对本篇知识点有更加详尽的解释。

浅谈Java模板引擎性能对比

从Github上翻到对JSP、Thymeleaf 3、Velocity 1.7、Freemarker 2.3.23几款主流模板的性能对比,总体上看,Freemarker、Velocity、JSP在性能上差别不大,而Thymeleaf与前三者相比,在性能上存在较大的差距,因此,选择Thymeleaf作为模板引擎需要慎重。

 参考:https://github.com/jreijn/spring-comparing-template-engines/issues/19

System Configuration

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 37
Model name: Intel(R) Core(TM) i5 CPU M 430 @ 2.27GHz
Stepping: 2
CPU MHz: 1199.000
CPU max MHz: 2267.0000
CPU min MHz: 1199.0000
BogoMIPS: 4522.04
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3

JSP

Document Path: /jsp
Document Length: 8515 bytes
Concurrency Level: 25
Time taken for tests: 13.003 seconds
Complete requests: 25000
Failed requests: 0
Keep-Alive requests: 0
Total transferred: 218825000 bytes
HTML transferred: 212875000 bytes
Requests per second: 1922.59 (#/sec) (mean)
Time per request: 13.003 (ms) (mean)
Time per request: 0.520 (ms) (mean, across all concurrent requests)
Transfer rate: 16434.05 (Kbytes/sec) received

Thymeleaf 3

Document Path: /thymeleaf
Document Length: 8849 bytes
Concurrency Level: 25
Time taken for tests: 23.303 seconds
Complete requests: 25000
Failed requests: 0
Keep-Alive requests: 0
Total transferred: 225300000 bytes
HTML transferred: 221225000 bytes
Requests per second: 1072.80 (#/sec) (mean)
Time per request: 23.303 (ms) (mean)
Time per request: 0.932 (ms) (mean, across all concurrent requests)
Transfer rate: 9441.52 (Kbytes/sec) received

Velocity 1.7

Document Path: /velocity
Document Length: 8951 bytes
Concurrency Level: 25
Time taken for tests: 13.200 seconds
Complete requests: 25000
Failed requests: 0
Keep-Alive requests: 0
Total transferred: 227975000 bytes
HTML transferred: 223775000 bytes
Requests per second: 1893.92 (#/sec) (mean)
Time per request: 13.200 (ms) (mean)
Time per request: 0.528 (ms) (mean, across all concurrent requests)
Transfer rate: 16865.88 (Kbytes/sec) received

Freemarker 2.3.23

Document Path: /freemarker
Document Length: 9035 bytes
Concurrency Level: 25
Time taken for tests: 12.988 seconds
Complete requests: 25000
Failed requests: 0
Keep-Alive requests: 0
Total transferred: 230075000 bytes
HTML transferred: 225875000 bytes
Requests per second: 1924.83 (#/sec) (mean)
Time per request: 12.988 (ms) (mean)
Time per request: 0.520 (ms) (mean, across all concurrent requests)
Transfer rate: 17299.01 (Kbytes/sec) received

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持码农之家。


参考资料

相关文章

  • Java设计模式中的外观模式详解

    发布:2023-04-08

    外观模式为多个复杂的子系统,提供了一个一致的界面,使得调用端只和这个接口发生调用,而无须关系这个子系统内部的细节。本文将通过示例详细为大家讲解一下外观模式,需要的可以参考一下


  • Java+Selenium实现控制浏览器的启动选项Options

    发布:2023-03-05

    这篇文章主要为大家详细介绍了如何使用java代码利用selenium控制浏览器的启动选项Options的代码操作,文中的示例代码讲解详细,感兴趣的可以了解一下


  • javaScript如何获取CSS样式

    发布:2021-05-19

    大家都知道CSS样式有三种类型:行内样式、内部样式和外部样式,这篇文章主要介绍了javaScript获取CSS样式的方法(兼容各浏览器),需要的朋友可以参考下


  • Java concurrency中AtomicReference原子类知识点总结

    发布:2020-06-13

    AtomicReference是作用是对对象进行原子操作。这篇文章主要介绍了Java concurrency之AtomicReference原子类,需要的朋友可以参考下


  • java怎么输出数组

    发布:2019-06-28

    java数组作为方法参数,java怎么输出数组元素,数组的输出方式有哪些?


  • java CompletableFuture实现异步编排详解

    发布:2023-04-20

    这篇文章主要为大家介绍了java CompletableFuture实现异步编排详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪


  • 基于Java快速实现一个简单版的HashMap详解

    发布:2023-04-12

    这篇文章主要为大家详细介绍了如何利用Java简单实现一个底层数据结构为数组 + 链表的HashMap,不考虑链表长度超过8个时变为红黑树的情况,需要的可以参考一下


  • Java中final关键字和final的四种用法实例

    发布:2023-04-12

    final关键字代表最终的、不可改变的,下面这篇文章主要给大家介绍了关于Java中final关键字和final的四种用法实例,文中通过图文以及实例代码介绍的非常详细,需要的朋友可以参考下


网友讨论