Questions tagged [object-pooling]

The object pool pattern is a software creational design pattern that uses a set of initialized objects kept ready to use – a "pool" – rather than allocating and destroying them on demand.

The object pool pattern is a software creational design pattern that uses a set of initialized objects kept ready to use – a "pool" – rather than allocating and destroying them on demand. A client of the pool will request an object from the pool and perform operations on the returned object. When the client has finished, it returns the object to the pool rather than destroying it; this can be done manually or automatically.

Object pools are primarily used for performance: in some circumstances, object pools significantly improve performance. Object pools complicate object lifetime, as objects obtained from and return to a pool are not actually created or destroyed at this time, and thus require care in implementation.

Object pooling can offer a significant performance boost in situations where the cost of initializing a class instance is high and the rate of instantiation and destruction of a class is high – in this case objects can frequently be reused, and each reuse saves a significant amount of time. Object pooling requires resources – memory and possibly other resources, such as network sockets, and thus it is preferable that the number of instances in use at any one time is low, but this is not required.

http://en.wikipedia.org/wiki/Object_pool_pattern

171 questions
0
votes
1 answer

Pool of byte arrays for serialization

Imagine a stateless web application that processes many requests, say a thousand per sec. All data that we create inside the processing cycle will be immediately discarded at the end. The app will use serialization/deserialization a lot, so we…
0
votes
0 answers

Hibernate and object pooling

I have a class ClassWithDates (let's call it "C") which contains a collection of dates. I have many objects of type C and thousands/millions of date objects, which often refer to the same time. I'd like to have a pool of date objects, and return an…
cdarwin
  • 4,141
  • 9
  • 42
  • 66
-1
votes
2 answers

Getting the error "The name 'ObjectPoolingManager' does not exist in the current context"

I am following a tutorial on how to make a gun to shoot a bullet, but I am getting this error: "The name 'ObjectPoolingManager' does not exist in the current context" I am following the tutorial exactly as is, and I don't know why this…
Arya Akhavein
  • 343
  • 1
  • 7
-1
votes
3 answers

List vs Array in unity pooling system

What is the fast approach of Pooling system in Unity? A List , simple Transform[] array , Queue or Stack ?
-1
votes
1 answer

Custom JSP Tag processor is caching a dated property, so the page shows old data and don't update, how to avoid this?

I made a custom jsp tag that search a historical value on a database an render it on the page. The attributes that the tag requires are the variable name and the date. The problem is that the 'date' property changes according clock move on ('date'…
Emiliano
  • 77
  • 6
-2
votes
1 answer

Object Pooling in Board Game AI

I was asked to create a Board Game AI(The game is pretty similar to the checkers). So far I finish a basic implementation of NegaScout with a bitboard and, within 5sec, I can go to 10 half-plies deep. The category of the game lies in…
1 2 3
11
12