All Projects → jhg023 → Pbbl

jhg023 / Pbbl

Licence: MIT license
A thread-safe ByteBuffer pool that allows for the automatic reuse of ByteBuffers, which can be over 30x faster than having to allocate a new ByteBuffer when needed.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Pbbl

xbytes
Parse bytes to human readable sizes (4747) → ('4.75 KB') and vice versa.
Stars: ✭ 17 (-46.87%)
Mutual labels:  bytes, byte
bytes-java
Bytes is a utility library that makes it easy to create, parse, transform, validate and convert byte arrays in Java. It supports endianness as well as immutability and mutability, so the caller may decide to favor performance.
Stars: ✭ 120 (+275%)
Mutual labels:  bytes, bytebuffer
octet
A library that makes working with bytebuffers painless.
Stars: ✭ 79 (+146.88%)
Mutual labels:  bytes, bytebuffer
pool-reference
Reference python implementation of Chia pool operations for pool operators
Stars: ✭ 452 (+1312.5%)
Mutual labels:  pool, pooling
pool
Go library that wraps http.Client to provide seamless higher-level connection pooling features
Stars: ✭ 39 (+21.88%)
Mutual labels:  pool, pooling
Puppeteer Cluster
Puppeteer Pool, run a cluster of instances in parallel
Stars: ✭ 2,175 (+6696.88%)
Mutual labels:  pool, pooling
Go Extend
go语言扩展包,收集一些常用的操作函数,辅助更快的完成开发工作,并减少重复代码
Stars: ✭ 839 (+2521.88%)
Mutual labels:  pool, bytes
bytekit
Java 字节操作的工具库(不是字节码的工具库)
Stars: ✭ 40 (+25%)
Mutual labels:  bytes, bytebuffer
go-pool
A better Generic Pool (sync.Pool)
Stars: ✭ 42 (+31.25%)
Mutual labels:  pool
Mandelbrot-set-explorer
An interactive Mandelbrot set, made with Python3 and Tkinter
Stars: ✭ 31 (-3.12%)
Mutual labels:  pool
workerpool
A workerpool that can get expanded & shrink dynamically.
Stars: ✭ 55 (+71.88%)
Mutual labels:  pool
http-server
A Java HTTP server in 35MB Docker image
Stars: ✭ 17 (-46.87%)
Mutual labels:  java-11
safeminer
全网第一款本地连接矿池加密软件,隐藏本地ip、加密数据包、流量混淆,可实现防止被监管的目的
Stars: ✭ 8 (-75%)
Mutual labels:  pool
finance-project-ddd
Projeto financeiro usando domain driven design, tdd, arquitetura hexagonal e solid
Stars: ✭ 67 (+109.38%)
Mutual labels:  pool
GoogleDriveBrowser
Goole Drive Download Library for iOS
Stars: ✭ 13 (-59.37%)
Mutual labels:  bytes
EvenMoreFish
An advanced fishing plugin based on MoreFish, created 2 years after its last update.
Stars: ✭ 53 (+65.63%)
Mutual labels:  java-11
kylin-jdbc-pool
better performance for kylin query
Stars: ✭ 15 (-53.12%)
Mutual labels:  pool
sentencepiece
R package for Byte Pair Encoding / Unigram modelling based on Sentencepiece
Stars: ✭ 22 (-31.25%)
Mutual labels:  byte
biguint-format
Node.js module to format big uint numbers from a byte array or a Buffer
Stars: ✭ 16 (-50%)
Mutual labels:  bytes
bytes
Work with bytes and implement network protocols
Stars: ✭ 77 (+140.63%)
Mutual labels:  bytes

Pbbl (pr. pebble, pɛbəl)

A thread-safe Buffer pool that allows for the automatic reuse of Buffer objects (including ByteBuffer, CharBuffer, etc.), which can be over 30x faster than having to allocate a new Buffer.

Maven/Gradle Dependency

  1. Add Pbbl as a dependency using either Maven or Gradle:

Maven:

<dependency>
  <groupId>com.github.jhg023</groupId>
  <artifactId>Pbbl</artifactId>
  <version>1.0.2</version>
</dependency>

Gradle:

implementation 'com.github.jhg023:Pbbl:1.0.2'
  1. Because Pbbl is compiled with Java 11, you must require its module in your module-info.java:
module my.project {
    requires com.github.pbbl;
}

Example(s)

  1. Create ByteBufferPool and manually close it:
// Create a ByteBufferPool (used to pool non-direct ByteBuffer objects).
var pool = new ByteBufferPool();

// Take a non-direct ByteBuffer (with 8 available bytes) from the pool.
// If the pool is empty, a new ByteBuffer will be created.
var buffer = pool.take(Long.BYTES);

// Do something with the ByteBuffer.
var array = buffer.putLong(42).array();

// Give the ByteBuffer back to the pool for re-use.
pool.give(buffer);

// Close the pool when finished.
pool.close();
  1. Create DirectFloatBufferPool and automatically close it:
// Create a DirectFloatBufferPool (used to pool direct FloatBuffer objects).
try (var pool = new DirectFloatBufferPool()) {
    // Take a direct FloatBuffer (with 8 available floats) from the pool.
    FloatBuffer buffer = pool.take(8);
    
    // Do something with the FloatBuffer.
    buffer.put(42f);
    
    // Give the FloatBuffer back to the pool for re-use.
    pool.give(buffer);
}
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].