Let's consider a scenario in which object pooling would be useful.
让我们考虑一个可以有效使用对象池的方案。
The basic pattern for object pooling looks something like this.
对象池的基本模式如下所示。
If your objects are not used with high frequency or do not have a high creation or destruction cost, then object pooling might not be the right strategy.
如果对象的使用频率不高,或者对象的创建或销毁成本不高,则对象池可能不是正确的策略。
What you don't see in Figure 3 is object pooling, automatic transaction processing, security, and all the other good things that EJB technology provides.
图3中没有看到的是对象池、自动事务处理、安全性以及EJB技术提供的所有其他好东西。
A lot of people are very enamored with object pooling, yet half the time people are not measuring to that to find out whether object pooling is any good.
很多人热衷于对象池,但起码有一半的情况下,人们并不去测量对象池的效果到底是好是坏。
Object constructors used in conjunction with object pooling provide the capabilities of a resource dispenser, without the effort of implementing a full resource dispenser.
与对象池一起使用的对象构造函数提供资源分配器的能力,无需实现完整的资源分配器。
Object pooling is a good example.
对象池就是一个很好的例子。
Object pooling is one solution to this problem.
对象池是这个问题的一种解决方案。
Object pooling reduces the number of allocations, and therefore the number of garbage collections, required by an application.
对象池机制可以降低应用程序所需的分配的数量,从而降低应用程序所需的垃圾回收的数量。
Object pooling only helps reduce the memory required for class allocations and the time required for object creation and destruction.
对象池只是有助于减少类分配所需的内存以及对象创建和销毁所需的时间。
Object pooling helps level out the number of allocations made on the heap, since the most common objects in an application can be pooled.
对象池机制有助于减小在堆上进行的分配的数量,因为可以汇聚应用程序中最常见的对象。
Object pooling can offer a significant performance boost; it is most effective in situations where the cost of initializing a class instance is high, the rate of instantiation of a class is high.
运用对象池化技术可以显著地提升性能,尤其是当对象的初始化过程代价较大或者频率较高时。
Object pooling can offer a significant performance boost; it is most effective in situations where the cost of initializing a class instance is high, the rate of instantiation of a class is high.
运用对象池化技术可以显著地提升性能,尤其是当对象的初始化过程代价较大或者频率较高时。
应用推荐