1 | {"version":3,"file":"pixi-object-pool.cjs","sources":["../../../node_modules/tslib/tslib.es6.js","../src/AverageProvider.ts","../src/ObjectPool.ts","../src/ObjectPoolFactory.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * Provides the exponential moving average of a sequence.\n *\n * Ignored because not directly exposed.\n *\n * @internal\n * @ignore\n * @class\n */\nexport class AverageProvider\n{\n private _history: number[];\n private _decayRatio: number;\n\n private _currentIndex: number;\n private _average: number;\n\n /**\n * @ignore\n * @param {number} windowSize - no. of inputs used to calculate window\n * @param {number} decayRatio - quantifies the weight of previous values (b/w 0 and 1)\n */\n constructor(windowSize: number, decayRatio: number)\n {\n this._history = new Array(windowSize);\n this._decayRatio = decayRatio;\n\n this._currentIndex = 0;\n\n for (let i = 0; i < windowSize; i++)\n {\n this._history[i] = 0;\n }\n }\n\n /**\n * @ignore\n * @param {number} input - the next value in the sequence\n * @returns {number} - the moving average\n */\n next(input: number): number\n {\n const { _history: history, _decayRatio: decayRatio } = this;\n const historyLength = history.length;\n\n this._currentIndex = this._currentIndex < historyLength - 1 ? this._currentIndex + 1 : 0;\n history[this._currentIndex] = input;\n\n let weightedSum = 0;\n let weight = 0;\n\n for (let i = this._currentIndex + 1; i < historyLength; i++)\n {\n weightedSum = (weightedSum + history[i]) * decayRatio;\n weight = (weight + 1) * decayRatio;\n }\n for (let i = 0; i <= this._currentIndex; i++)\n {\n weightedSum = (weightedSum + history[i]) * decayRatio;\n weight = (weight + 1) * decayRatio;\n }\n\n this._average = weightedSum / weight;\n\n return this._average;\n }\n\n absDev(): number\n {\n let errSum = 0;\n\n for (let i = 0, j = this._history.length; i < j; i++)\n {\n errSum += Math.abs(this._history[i] - this._average);\n }\n\n return errSum / this._history.length;\n }\n}\n","import { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { AverageProvider } from './AverageProvider';\n\n/**\n * @interface\n * @public\n */\nexport interface IObjectPoolOptions\n{\n capacityRatio?: number;\n decayRatio?: number;\n reserve?: number;\n}\n\n/**\n * `ObjectPool` provides the framework necessary for pooling minus the object instantiation\n * method. You can use `ObjectPoolFactory` for objects that can be created using a default\n * constructor.\n *\n * @template T\n * @class\n * @public\n */\nexport abstract class ObjectPool<T extends typeof Object>\n{\n protected _freeList: Array<T>;\n protected _freeCount: number;\n protected _reserveCount: number;\n\n protected _borrowRate: number;\n protected _returnRate: number;\n protected _flowRate: number;\n protected _borrowRateAverage: number;\n protected _marginAverage: number;\n\n private _capacityRatio: number;\n private _decayRatio: number;\n private _borrowRateAverageProvider: AverageProvider;\n private _marginAverageProvider: AverageProvider;\n\n /**\n * @param {IObjectPoolOptions} options\n */\n constructor(options: IObjectPoolOptions = {})\n {\n /**\n * Supply pool of objects that can be used to immediately lend.\n *\n * @member {Array<T>}\n * @protected\n */\n this._freeList = [];\n\n /**\n * Number of objects in the pool. This is less than or equal to `_pool.length`.\n *\n * @member {number}\n * @protected\n */\n this._freeCount = 0;\n\n this._borrowRate = 0;\n this._returnRate = 0;\n this._flowRate = 0;\n this._borrowRateAverage = 0;\n\n this._reserveCount = options.reserve || 0;\n this._capacityRatio = options.capacityRatio || 1.2;\n this._decayRatio = options.decayRatio || 0.67;\n this._marginAverage = 0;\n this._borrowRateAverageProvider = new AverageProvider(128, this._decayRatio);\n this._marginAverageProvider = new AverageProvider(128, this._decayRatio);\n }\n\n /**\n * Instantiates a new object of type `T`.\n *\n * @abstract\n * @returns {T}\n */\n abstract create(): T;\n\n // TODO: Support object destruction. It might not be so good for perf tho.\n // /**\n // * Destroys the object before discarding it.\n // *\n // * @param {T} object\n // */\n // abstract destroyObject(object: T): void;\n\n /**\n * The number of objects that can be stored in the pool without allocating more space.\n *\n * @member {number}\n */\n protected get capacity(): number\n {\n return this._freeList.length;\n }\n protected set capacity(cp: number)\n {\n this._freeList.length = Math.ceil(cp);\n }\n\n /**\n * Obtains an instance from this pool.\n *\n * @returns {T}\n */\n allocate(): T\n {\n ++this._borrowRate;\n\n ++this._flowRate;\n\n if (this._freeCount > 0)\n {\n return this._freeList[--this._freeCount];\n }\n\n return this.create();\n }\n\n /**\n * Returns the object to the pool.\n *\n * @param {T} object\n */\n release(object: T): void\n {\n ++this._returnRate;\n --this._flowRate;\n\n if (this._freeCount === this.capacity)\n {\n this.capacity *= this._capacityRatio;\n }\n\n this._freeList[this._freeCount] = object;\n ++this._freeCount;\n }\n\n /**\n * Preallocates objects so that the pool size is at least `count`.\n *\n * @param {number} count\n */\n reserve(count: number): void\n {\n this._reserveCount = count;\n\n if (this._freeCount < count)\n {\n const diff = this._freeCount - count;\n\n for (let i = 0; i < diff; i++)\n {\n this._freeList[this._freeCount] = this.create();\n ++this._freeCount;\n }\n }\n }\n\n /**\n * Dereferences objects for the GC to collect and brings the pool size down to `count`.\n *\n * @param {number} count\n */\n limit(count: number): void\n {\n if (this._freeCount > count)\n {\n const oldCapacity = this.capacity;\n\n if (oldCapacity > count * this._capacityRatio)\n {\n this.capacity = count * this._capacityRatio;\n }\n\n const excessBound = Math.min(this._freeCount, this.capacity);\n\n for (let i = count; i < excessBound; i++)\n {\n this._freeList[i] = null;\n }\n }\n }\n\n /**\n * Install the GC on the shared ticker.\n *\n * @param {Ticker}[ticker=Ticker.shared]\n */\n startGC(ticker: Ticker = Ticker.shared): void\n {\n ticker.add(this._gcTick, null, UPDATE_PRIORITY.UTILITY);\n }\n\n /**\n * Stops running the GC on the pool.\n *\n * @param {Ticker}[ticker=Ticker.shared]\n */\n stopGC(ticker: Ticker = Ticker.shared): void\n {\n ticker.remove(this._gcTick);\n }\n\n private _gcTick = (): void =>\n {\n this._borrowRateAverage = this._borrowRateAverageProvider.next(this._borrowRate);\n this._marginAverage = this._marginAverageProvider.next(this._freeCount - this._borrowRate);\n\n const absDev = this._borrowRateAverageProvider.absDev();\n\n this._flowRate = 0;\n this._borrowRate = 0;\n this._returnRate = 0;\n\n const poolSize = this._freeCount;\n const poolCapacity = this._freeList.length;\n\n // If the pool is small enough, it shouldn't really matter\n if (poolSize < 128 && this._borrowRateAverage < 128 && poolCapacity < 128)\n {\n return;\n }\n\n // If pool is say, 2x, larger than borrowing rate on average (adjusted for variance/abs-dev), then downsize.\n const threshold = Math.max(this._borrowRateAverage * (this._capacityRatio - 1), this._reserveCount);\n\n if (this._freeCount > threshold + absDev)\n {\n const newCap = threshold + absDev;\n\n this.capacity = Math.min(this._freeList.length, Math.ceil(newCap));\n this._freeCount = this._freeList.length;\n }\n };\n}\n","import { ObjectPool } from './ObjectPool';\n\nconst poolMap: Map<typeof Object, ObjectPool<any>> = new Map();\n\n/**\n * Factory for creating pools of objects with default constructors. It will store the pool of\n * a given type and reuse it on further builds.\n *\n * @class\n * @public\n * @example\n * ```js\n * import { ObjectPool, ObjectPoolFactory } from 'pixi-object-pool';\n *\n * class AABB {}\n *\n * const opool: ObjectPool<AABB> = ObjectPoolFactory.build(AABB) as ObjectPool<AABB>;\n *\n * const temp = opool.borrowObject();\n * // do something\n * opool.returnObject(temp);\n * ```\n */\nexport class ObjectPoolFactory\n{\n /**\n * @param {Class} Type\n */\n static build(Type: typeof Object): ObjectPool<any>\n {\n let pool = poolMap.get(Type);\n\n if (pool)\n {\n return pool;\n }\n\n pool = new (class DefaultObjectPool extends ObjectPool<any>\n {\n create(): any\n {\n return new Type();\n }\n })();\n\n poolMap.set(Type, pool);\n\n return pool;\n }\n}\n"],"names":["ticker","Ticker","UPDATE_PRIORITY"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnF,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;AAChC,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,C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