持久层吞吐量优化组件 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

数据结构与算法分析

数据结构与算法分析

韦斯(Mark Allen Weiss) / 机械工业出版社 / 2010-8 / 45.00元

《数据结构与算法分析:C语言描述》曾被评为20世纪顶尖的30部计算机著作之一,作者在数据结构和算法分析方面卓有建树,他的数据结构和算法分析的著作尤其畅销,并受到广泛好评,已被世界500余所大学选作教材。 在《数据结构与算法分析:C语言描述》中,作者精炼并强化了他对算法和数据结构方面创新的处理方法。通过C程序的实现,着重阐述了抽象数据类型的概念,并对算法的效率、性能和运行时间进行了分析。 ......一起来看看 《数据结构与算法分析》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

MD5 加密
MD5 加密

MD5 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具