持久层吞吐量优化组件 buffer-slayer

码农软件 · 软件分类 · 程序调试工具 · 2019-11-29 21:43:52

软件介绍

buffer-slayer 是一个把请求在内存中 buffer 并批量发送的工具,适用于批量能显著提升性能的组件(redis-client、jdbc), 支持一对一的回调。

快速启动


  io.bufferslayer
  buffer-spring-jdbc
  1.1.0
ReporterProperties reporterProperties = new ReporterProperties()
        .setBufferedMaxMessages(500)
        .setPendingMaxMessages(10000)
        .setMetrics("inmemory")
        .setMetricsExporter("http")
        .setParallelismPerBatch(5)
        .setSenderExecutor(new ThreadPoolExecutor(200,
            200, 0, TimeUnit.MILLISECONDS, new SynchronousQueue<>()));

BatchedJdbcTemplate template = new BatchedJdbcTemplate(reporterProperties);
template.setDataSource(dataSource);

Promise promise = template.update(...);
promise.done(success -> ...)
       .fail(reject -> ...);

吞吐量对比

Benchmark                                                      Mode  Cnt       Score  Units
BatchedJdbcTemplateBenchmark.high_contention_batched          thrpt   15    8709.042  ops/s
BatchedJdbcTemplateBenchmark.high_contention_unbatched        thrpt   15     271.529  ops/s
BatchedJdbcTemplateBenchmark.mild_contention_batched          thrpt   15    2146.595  ops/s
BatchedJdbcTemplateBenchmark.mild_contention_unbatched        thrpt   15     262.621  ops/s
BatchedJdbcTemplateBenchmark.no_contention_batched            thrpt   15    1194.852  ops/s
BatchedJdbcTemplateBenchmark.no_contention_unbatched          thrpt   15     201.806  ops/s

 

本文地址:https://codercto.com/soft/d/20083.html

C#本质论

C#本质论

米凯利斯 / 周靖 / 人民邮电出版社 / 2010-9 / 99.00元

《C#本质论(第3版)》是一部好评如潮的语言参考书,作者用一种非常合理的方式来组织《C#本质论(第3版)》的内容,由浅人深地介绍了C#语言的各个方面。全书共包括21章及6个附录,每章开头的“思维导图”指明了本章要讨论的主题,以及各个主题之间的层次关系。书中所包含的丰富的示例代码和精要的语言比较,都有助于读者理解C#语言。《C#本质论(第3版)》首先介绍了C#语言的基础知识,随后深人讲解了泛型、迭代......一起来看看 《C#本质论》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

SHA 加密
SHA 加密

SHA 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具