public final class BytesPool extends Object
Bytes
instances.
This class uses a ThreadLocal
to store a single Bytes
instance per thread,
which can be reused to avoid the overhead of creating a new instance every time bytes are
needed for operations.
This class is primarily meant to be used in high-performance environments where reducing object creation is crucial.
Constructor and Description |
---|
BytesPool() |
Modifier and Type | Method and Description |
---|---|
static net.openhft.chronicle.core.scoped.ScopedResourcePool<Bytes<?>> |
createThreadLocal()
Create a scoped-thread-local pool of bytes resources
|
static net.openhft.chronicle.core.scoped.ScopedResourcePool<Bytes<?>> |
createThreadLocal(int instancesPerThread)
Create a scoped-thread-local pool of bytes resources
|
public static net.openhft.chronicle.core.scoped.ScopedResourcePool<Bytes<?>> createThreadLocal()
public static net.openhft.chronicle.core.scoped.ScopedResourcePool<Bytes<?>> createThreadLocal(int instancesPerThread)
instancesPerThread
- The maximum number of instances to retain per threadCopyright © 2024. All rights reserved.