For faster navigation, this Iframe is preloading the Wikiwand page for 对象池模式.

对象池模式

本条目存在以下问题,请协助改善本条目或在讨论页针对议题发表看法。 此条目需要扩充。 (2013年9月4日)请协助改善这篇条目,更进一步的信息可能会在讨论页扩充请求中找到。请在扩充条目后将此模板移除。 此条目需要精通或熟悉相关主题的编者参与及协助编辑。 (2013年9月4日)请邀请适合的人士改善本条目。更多的细节与详情请参见讨论页。 此条目没有列出任何参考或来源。 (2013年9月4日)维基百科所有的内容都应该可供查证。请协助补充可靠来源改善这篇条目。无法查证的内容可能会因为异议提出而被移除。
对象池,object pool pattern

对象池(英语:object pool pattern)是一种设计模式。一个对象池包含一组已经初始化过且可以使用的对象,而可以在有需求时创建和销毁对象。池的用户可以从池子中取得对象,对其进行操作处理,并在不需要时归还给池子而非直接销毁它。这是一种特殊的工厂对象。

若初始化、实例化的代价高,且有需求需要经常实例化,但每次实例化的数量较少的情况下,使用对象池可以获得显著的效能提升。从池子中取得对象的时间是可预测的,但新建一个实例所需的时间是不确定。

参考资料

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
对象池模式
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?