All Projects → chrisvest → Stormpot

chrisvest / Stormpot

Licence: apache-2.0
A fast object pool for the JVM

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Stormpot

Ava
Node.js test runner that lets you develop with confidence 🚀
Stars: ✭ 19,458 (+7187.64%)
Mutual labels:  concurrency, performance, tdd
Libcopp
cross-platform coroutine library in c++
Stars: ✭ 398 (+49.06%)
Mutual labels:  pool, performance, high-performance
Slb
Simple Load Balancer
Stars: ✭ 118 (-55.81%)
Mutual labels:  pool, concurrency
Smproxy
Swoole MySQL Proxy 一个基于 MySQL 协议,Swoole 开发的MySQL数据库连接池。 A MySQL database connection pool based on MySQL protocol and Swoole.
Stars: ✭ 1,665 (+523.6%)
Mutual labels:  pool, connection-pool
finance-project-ddd
Projeto financeiro usando domain driven design, tdd, arquitetura hexagonal e solid
Stars: ✭ 67 (-74.91%)
Mutual labels:  tdd, pool
Pgagroal
High-performance connection pool for PostgreSQL
Stars: ✭ 362 (+35.58%)
Mutual labels:  pool, high-performance
Pool
General Purpose Connection Pool for GRPC,RPC,TCP Sevice Cluster
Stars: ✭ 98 (-63.3%)
Mutual labels:  pool, connection-pool
workerpool
A workerpool that can get expanded & shrink dynamically.
Stars: ✭ 55 (-79.4%)
Mutual labels:  concurrency, pool
Vert.x
Vert.x is a tool-kit for building reactive applications on the JVM
Stars: ✭ 12,544 (+4598.13%)
Mutual labels:  concurrency, high-performance
thread-pool
A modern thread pool implementation based on C++20
Stars: ✭ 104 (-61.05%)
Mutual labels:  high-performance, concurrency
pool
Go library that wraps http.Client to provide seamless higher-level connection pooling features
Stars: ✭ 39 (-85.39%)
Mutual labels:  pool, connection-pool
agroal
The natural database connection pool
Stars: ✭ 92 (-65.54%)
Mutual labels:  high-performance, pool
Threadly
A library of tools to assist with safe concurrent java development. Providing unique priority based thread pools, and ways to distrbute threaded work safely.
Stars: ✭ 196 (-26.59%)
Mutual labels:  concurrency, high-performance
Gowp
golang worker pool , Concurrency limiting goroutine pool
Stars: ✭ 259 (-3%)
Mutual labels:  pool, concurrency
Pond
Minimalistic and High-performance goroutine worker pool written in Go
Stars: ✭ 187 (-29.96%)
Mutual labels:  concurrency, high-performance
Mobc
A generic connection pool for Rust with async/await support
Stars: ✭ 141 (-47.19%)
Mutual labels:  pool, connection-pool
Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (-93.26%)
Mutual labels:  high-performance, concurrency
Interviews
A list of fancy questions I've been asked during the interviews I had. Some of them I ask when interviewing people.
Stars: ✭ 140 (-47.57%)
Mutual labels:  concurrency, tdd
Akka
Build highly concurrent, distributed, and resilient message-driven applications on the JVM
Stars: ✭ 11,938 (+4371.16%)
Mutual labels:  concurrency, high-performance
Polyel-Framework
⚡️ Voltis Core: A PHP framework based on Swoole from the ground up
Stars: ✭ 22 (-91.76%)
Mutual labels:  concurrency, connection-pool

== Stormpot

Stormpot is an object pooling library for Java. Use it to recycle objects that are expensive to create. The library will take care of creating and destroying your objects in the background.

image:https://api.travis-ci.org/chrisvest/stormpot.svg?branch=master[Build status, link=https://travis-ci.org/chrisvest/stormpot] image:https://img.shields.io/lgtm/grade/java/g/chrisvest/stormpot.svg?logo=lgtm&logoWidth=18[Code quality, link=https://lgtm.com/projects/g/chrisvest/stormpot/context:java] image:https://codecov.io/gh/chrisvest/stormpot/branch/master/graph/badge.svg[Code coverage, link=https://codecov.io/gh/chrisvest/stormpot]

Stormpot is very mature, is used in production, and has done hundreds of trillions footnote:[Fermi estimate.] claim-release cycles in testing. It is faster and scales better than any competing pool.

=== Why choose Stormpot?

There are a number of options out there, when it comes to object pools on the JVM. Stormpot has been carefully designed for high performance, and robust operation. Some of the things that sets Stormpot apart include:

[NOTE]

Stormpot is an object pool; a homogeneous collection of objects, where it does not matter which particular instance is returned from claim since the objects are all similar. If your objects instead are heterogeneous, with different attributes and identified by a key, then what you need is a object cache. We recommend https://github.com/ben-manes/caffeine[Caffeine] for object caching.

=== Installing

Stormpot 3.1 only depends on Java 11 or newer. Add it as a Maven dependency to your projects:

[source,xml]

com.github.chrisvest stormpot 3.1 ----

You can also build the latest snapshot from source with mvn clean install.

=== Getting Started

Stormpot needs 3 things before it can pool objects for you:

. A http://chrisvest.github.io/stormpot/site/apidocs/stormpot/stormpot/Poolable.html[Poolable] type of objects it can pool. You have to implement this yourself. . An http://chrisvest.github.io/stormpot/site/apidocs/stormpot/stormpot/Allocator.html[Allocator] to allocate and deallocate the Poolable objects. You have to implement this yourself. . And a place where it all comes together:

[source,java]

MyAllocator allocator = new MyAllocator(); Pool pool = Pool.from(allocator).build(); Timeout timeout = new Timeout(1, TimeUnit.SECONDS);

MyPoolable object = pool.claim(timeout); try { // Do stuff with 'object'. // Note: 'claim' returns 'null' if it times out. } finally { if (object != null) { object.release(); } }

=== Contributing

  • Report bugs preferably with a failing test. You can submit a pull-request that adds a failing test that demonstrates the behaviour you think is wrong or missing. Travis-CI will build it, report the failure and shorten the feedback cycle. If you don't know how to write a test for something, then that's fine too. Just open an issue describing your configuration and environment, what you observe, and what you think should happen instead.
  • Improve the documentation by all means! Just fork the project and start. If you have questions about implementation or behavioural details, then start a discussion about it by opening a pull-request or an issue. Documentation and javadoc is formatted with http://asciidoctor.org/[AsciiDoctor]. The website and javadocs can be generated with mvn clean pre-site javadoc:javadoc.
  • Fix bugs or implement features by forking the project, but please start an issue about the bug or feature you want to work on (or find the existing issue) and describe the approach and design you have in mind. Keep in mind that Stormpot is implemented with a very strict adherence to TDD. Finally, make sure to respect the existing indentation and formatting. Use mvn checkstyle:check to check your formatting. If you are writing a test that takes more than a few hundred milliseconds to run, then put it in the stormpot.slow test package; either in the existing PoolIT suite, or in a new \*IT suite. Use mvn clean test to run only the fast tests. Use mvn clean verify to also run the slow tests. Javadoc comments are formatted with http://asciidoctor.org/[AsciiDoctor]. Get test coverage with mvn clean test site and open target/site/jacoco/index.html. Get mutation test coverage with mvn clean test-compile org.pitest:pitest-maven:mutationCoverage and open target/pit-reports/*/index.html.
  • Update Maven plugins with mvn versions:display-plugin-updates, or other dependencies with versions:display-dependency-updates.
  • Add to the ecosystem and make Stormpot more than just an object pool. This is a good thing to take on if you'd like to contribute code, but you find the Stormpot code base itself to be intimidating (which, by the way, I completely understand). ** There is a repository for https://github.com/chrisvest/object-pool-benchmarks[object pool benchmarks] that is being maintained along side Stormpot. Adding more benchmarks and cases; analysing results; trying out optimisations. These are all useful things to do. ** I started working on a https://github.com/chrisvest/stormpot-jdbc[JDBC connection pool] based on Stormpot, but the project has stagnated. It is no doubt a useful thing to have, though. If you want to take on that problem, either with offset in the existing code or by starting over from scratch, then please go ahead. ** I'm sure there are other interesting related problems out there to take on. There are many database drivers for various NoSQL databases, that have object pooling needs.

Whatever you decide to do, don't hesitate to ask questions on the mailing list or on github if you have doubts or get stuck.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].