chris2018998 / beeop Goto Github PK
View Code? Open in Web Editor NEWA small java object pool
License: GNU Lesser General Public License v2.1
A small java object pool
License: GNU Lesser General Public License v2.1
有无一些关于对象池设计的讲解,比如为什么该对象池会这么快?
网上并没有找到非常有营养的相关文章
如题,做了一个 BeeOP
和 commons-pool2
对比测试,结果表明,特定场景下,效果非常好。
Benchmark Mode Cnt Score Error Units
ObjectPoolBenchmark.testBeeOP thrpt 30 43178816.940 ± 4428429.024 ops/s
ObjectPoolBenchmark.testBeeOPAsArray thrpt 30 43057.135 ± 423.165 ops/s
ObjectPoolBenchmark.testCommonsPool thrpt 30 2280809.683 ± 39073.261 ops/s
ObjectPoolBenchmark.testCommonsPoolAsArray thrpt 30 20907.926 ± 128.897 ops/s
ObjectPoolBenchmark.testNew thrpt 30 202345460.573 ± 2032248.689 ops/s
ObjectPoolBenchmark.testNewAsArray thrpt 30 1832622.826 ± 12826.881 ops/s
分两个场景测试:
http
请求方式从测试结果看,BeeOP
对场景1进行了特殊处理:通过 ThreadLocal
极大加速了这类场景的使用效能。但是,对于场景二,受限于结构,就不这么突出了,但是仍然比 commons-pool2
高1倍。
代码如下/code as blow :
jmh.benchmark.tar.gz
因为业务需要,会基于参数变更connection的catalog。
默认不设置catalog,连接如下:
127.0.0.1:3306/?useUnicode=true&useSSL=false
在设置catalog后,beecp执行完SQL,关闭connection时,通过recycleSelf调用resetRawConn按照defCatalog进行复位
产生如下问题:
1、出于什么考虑,再会connection关闭后进行复位?
2、是否可以关闭该复位?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.