@choksheak/react-utils 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NoSSR.cjs +1 -1
- package/NoSSR.d.ts +7 -3
- package/NoSSR.min.cjs +1 -1
- package/NoSSR.min.mjs +1 -1
- package/NoSSR.mjs +1 -1
- package/{chunk-33UMQLKY.mjs → chunk-4235I4VO.mjs} +1 -10
- package/{chunk-GPV6JIQK.mjs → chunk-4J7TN5JN.mjs} +1 -1
- package/chunk-BBCGQMWI.min.cjs +2 -0
- package/chunk-BBCGQMWI.min.cjs.map +1 -0
- package/{chunk-5DO7KC3L.cjs → chunk-CYTO5EZE.cjs} +2 -11
- package/chunk-GKNOICX3.cjs +561 -0
- package/chunk-HRE7YPUJ.min.mjs +2 -0
- package/chunk-IS3BZTWE.cjs +35 -0
- package/chunk-JOHZV3FD.min.cjs +2 -0
- package/{chunk-F5L32IUC.min.cjs.map → chunk-JOHZV3FD.min.cjs.map} +1 -1
- package/chunk-KGN4HQPP.min.cjs +2 -0
- package/chunk-KGN4HQPP.min.cjs.map +1 -0
- package/chunk-NL4FU2MJ.min.mjs +2 -0
- package/chunk-NL4FU2MJ.min.mjs.map +1 -0
- package/chunk-R7POPVJR.mjs +35 -0
- package/chunk-TI3FMEYP.min.mjs +2 -0
- package/{chunk-RM4ZGGZ2.min.mjs.map → chunk-TI3FMEYP.min.mjs.map} +1 -1
- package/chunk-U7RD7B3N.min.mjs +2 -0
- package/chunk-U7RD7B3N.min.mjs.map +1 -0
- package/{chunk-WVLPJPWG.cjs → chunk-WXLUEDBO.cjs} +3 -3
- package/chunk-X6EKF4N7.mjs +561 -0
- package/chunk-ZCDXPV3A.min.cjs +2 -0
- package/chunk-ZCDXPV3A.min.cjs.map +1 -0
- package/dist-O6NNX4Y3.min.mjs +2 -0
- package/dist-O6NNX4Y3.min.mjs.map +1 -0
- package/dist-SEGTJ72R.min.cjs +2 -0
- package/dist-SEGTJ72R.min.cjs.map +1 -0
- package/dist-UKP7SPWZ.cjs +545 -0
- package/dist-YXYQDOH5.mjs +545 -0
- package/index.cjs +43 -0
- package/index.d.cts +8 -0
- package/index.d.ts +8 -0
- package/index.min.cjs +2 -0
- package/index.min.cjs.map +1 -0
- package/index.min.mjs +2 -0
- package/index.min.mjs.map +1 -0
- package/index.mjs +43 -0
- package/magic-string.es-5QZEPJXJ.min.mjs +14 -0
- package/magic-string.es-5QZEPJXJ.min.mjs.map +1 -0
- package/magic-string.es-EREYSDLL.mjs +1308 -0
- package/magic-string.es-FXUUD55Y.min.cjs +14 -0
- package/magic-string.es-FXUUD55Y.min.cjs.map +1 -0
- package/magic-string.es-HC5PDAU3.cjs +1308 -0
- package/package.json +71 -168
- package/sharedQuery.cjs +8 -555
- package/{sharedQuery.d.mts → sharedQuery.d.cts} +2 -2
- package/sharedQuery.d.ts +23 -17
- package/sharedQuery.min.cjs +1 -1
- package/sharedQuery.min.cjs.map +1 -1
- package/sharedQuery.min.mjs +1 -1
- package/sharedQuery.min.mjs.map +1 -1
- package/sharedQuery.mjs +9 -556
- package/sharedState.cjs +1 -1
- package/{sharedState.d.mts → sharedState.d.cts} +1 -1
- package/sharedState.d.ts +17 -11
- package/sharedState.min.cjs +1 -1
- package/sharedState.min.mjs +1 -1
- package/sharedState.mjs +1 -1
- package/storage.cjs +1 -1
- package/storage.d.ts +13 -9
- package/storage.min.cjs +1 -1
- package/storage.min.mjs +1 -1
- package/storage.mjs +1 -1
- package/stringify.cjs +3 -5
- package/stringify.d.ts +3 -1
- package/stringify.min.cjs +1 -1
- package/stringify.min.cjs.map +1 -1
- package/stringify.min.mjs +1 -1
- package/stringify.mjs +2 -4
- package/useDeepMemo.cjs +3 -3
- package/useDeepMemo.d.ts +3 -1
- package/useDeepMemo.min.cjs +1 -1
- package/useDeepMemo.min.mjs +1 -1
- package/useDeepMemo.mjs +2 -2
- package/chunk-74BS2FAO.cjs +0 -12
- package/chunk-F5L32IUC.min.cjs +0 -2
- package/chunk-KE3RXVMS.min.cjs +0 -2
- package/chunk-KE3RXVMS.min.cjs.map +0 -1
- package/chunk-MWDH7YON.min.mjs +0 -2
- package/chunk-RM4ZGGZ2.min.mjs +0 -2
- package/chunk-TEZPF6BG.min.cjs +0 -2
- package/chunk-TEZPF6BG.min.cjs.map +0 -1
- package/chunk-V7L3UICC.min.mjs +0 -2
- package/chunk-V7L3UICC.min.mjs.map +0 -1
- package/chunk-X6BYQHVC.mjs +0 -12
- /package/{NoSSR.d.mts → NoSSR.d.cts} +0 -0
- /package/{chunk-MWDH7YON.min.mjs.map → chunk-HRE7YPUJ.min.mjs.map} +0 -0
- /package/{storage.d.mts → storage.d.cts} +0 -0
- /package/{stringify.d.mts → stringify.d.cts} +0 -0
- /package/{useDeepMemo.d.mts → useDeepMemo.d.cts} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('./chunk-ZCDXPV3A.min.cjs');var R=Object.defineProperty,P=t=>{throw TypeError(t)},W=(t,e,r)=>e in t?R(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,I=(t,e,r)=>W(t,typeof e!="symbol"?e+"":e,r),q=(t,e,r)=>e.has(t)||P("Cannot "+r),m=(t,e,r)=>(q(t,e,"read from private field"),r?r.call(t):e.get(t)),E=(t,e,r)=>e.has(t)?P("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),w=(t,e,r,s)=>(q(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),x=(t,e,r,s)=>({set _(h){w(t,e,h,r)},get _(){return m(t,e,s)}}),B=class{constructor(t){I(this,"value"),I(this,"next"),this.value=t}},p,v,f,F=class{constructor(){E(this,p),E(this,v),E(this,f),this.clear()}enqueue(t){let e=new B(t);m(this,p)?(m(this,v).next=e,w(this,v,e)):(w(this,p,e),w(this,v,e)),x(this,f)._++}dequeue(){let t=m(this,p);if(t)return w(this,p,m(this,p).next),x(this,f)._--,t.value}clear(){w(this,p,void 0),w(this,v,void 0),w(this,f,0)}get size(){return m(this,f)}*[Symbol.iterator](){let t=m(this,p);for(;t;)yield t.value,t=t.next}};p=new WeakMap,v=new WeakMap,f=new WeakMap;function g(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new F,r=0,s=()=>{r--,e.size>0&&e.dequeue()()},h=async(n,l,c)=>{r++;let i=(async()=>n(...c))();l(i);try{await i}catch (e2){}s()},u=(n,l,c)=>{e.enqueue(h.bind(void 0,n,l,c)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},o=(n,...l)=>new Promise(c=>{u(n,c,l)});return Object.defineProperties(o,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),o}function a(t,e=null){let r=new Event(t);return e&&Object.defineProperty(r,"task",{value:e,enumerable:!0,writable:!1,configurable:!1}),r}var Q={1:12.71,2:4.303,3:3.182,4:2.776,5:2.571,6:2.447,7:2.365,8:2.306,9:2.262,10:2.228,11:2.201,12:2.179,13:2.16,14:2.145,15:2.131,16:2.12,17:2.11,18:2.101,19:2.093,20:2.086,21:2.08,22:2.074,23:2.069,24:2.064,25:2.06,26:2.056,27:2.052,28:2.048,29:2.045,30:2.042,31:2.0399,32:2.0378,33:2.0357,34:2.0336,35:2.0315,36:2.0294,37:2.0273,38:2.0252,39:2.0231,40:2.021,41:2.0198,42:2.0186,43:2.0174,44:2.0162,45:2.015,46:2.0138,47:2.0126,48:2.0114,49:2.0102,50:2.009,51:2.0081,52:2.0072,53:2.0063,54:2.0054,55:2.0045,56:2.0036,57:2.0027,58:2.0018,59:2.0009,60:2,61:1.9995,62:1.999,63:1.9985,64:1.998,65:1.9975,66:1.997,67:1.9965,68:1.996,69:1.9955,70:1.995,71:1.9945,72:1.994,73:1.9935,74:1.993,75:1.9925,76:1.992,77:1.9915,78:1.991,79:1.9905,80:1.99,81:1.9897,82:1.9894,83:1.9891,84:1.9888,85:1.9885,86:1.9882,87:1.9879,88:1.9876,89:1.9873,90:1.987,91:1.9867,92:1.9864,93:1.9861,94:1.9858,95:1.9855,96:1.9852,97:1.9849,98:1.9846,99:1.9843,100:1.984,101:1.9838,102:1.9836,103:1.9834,104:1.9832,105:1.983,106:1.9828,107:1.9826,108:1.9824,109:1.9822,110:1.982,111:1.9818,112:1.9816,113:1.9814,114:1.9812,115:1.9819,116:1.9808,117:1.9806,118:1.9804,119:1.9802,120:1.98,infinity:1.96},C=Q,V=t=>t/1e6,K= exports.hrtimeNow =()=>V(Number(process.hrtime.bigint())),Y= exports.now =()=>performance.now();function $(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var D=(t,e)=>t.reduce((r,s)=>r+(s-e)**2,0)/(t.length-1)||0,G=(async()=>{}).constructor,H=t=>t.constructor===G,J=async t=>{if(H(t.fn))return!0;try{if(t.opts.beforeEach!=null)try{await t.opts.beforeEach.call(t)}catch (e3){}let e=t.fn(),r=$(e);if(r)try{await e}catch (e4){}if(t.opts.afterEach!=null)try{await t.opts.afterEach.call(t)}catch (e5){}return r}catch (e6){return!1}},L= exports.Task =class extends EventTarget{constructor(t,e,r,s={}){super(),this.runs=0,this.bench=t,this.name=e,this.fn=r,this.opts=s}async loop(t,e){var r;let s=this.bench.concurrency==="task",{threshold:h}=this.bench,u=0,o=[];if(this.opts.beforeAll!=null)try{await this.opts.beforeAll.call(this)}catch(i){return{error:i}}let n=await J(this),l=async()=>{this.opts.beforeEach!=null&&await this.opts.beforeEach.call(this);let i=0;if(n){let d=this.bench.now();await this.fn.call(this),i=this.bench.now()-d}else{let d=this.bench.now();this.fn.call(this),i=this.bench.now()-d}o.push(i),u+=i,this.opts.afterEach!=null&&await this.opts.afterEach.call(this)},c=g(h);try{let i=[];for(;(u<t||o.length+c.activeCount+c.pendingCount<e)&&!((r=this.bench.signal)!=null&&r.aborted);)s?i.push(c(l)):await l();i.length&&await Promise.all(i)}catch(i){return{error:i}}if(this.opts.afterAll!=null)try{await this.opts.afterAll.call(this)}catch(i){return{error:i}}return{samples:o}}async run(){var t,e;if((t=this.result)!=null&&t.error)return this;this.dispatchEvent(a("start",this)),await this.bench.setup(this,"run");let{samples:r,error:s}=await this.loop(this.bench.time,this.bench.iterations);if(this.bench.teardown(this,"run"),r){let h=r.reduce((b,y)=>b+y,0);this.runs=r.length,r.sort((b,y)=>b-y);let u=h/this.runs,o=1e3/u,n=r.length,l=n-1,c=r[0],i=r[l],d=h/r.length||0,k=D(r,d),T=Math.sqrt(k),_=T/Math.sqrt(n),N=C[String(Math.round(l)||1)]||C.infinity,M=_*N,z=M/d*100,S=r[Math.ceil(n*.75)-1],j=r[Math.ceil(n*.99)-1],O=r[Math.ceil(n*.995)-1],A=r[Math.ceil(n*.999)-1];if((e=this.bench.signal)!=null&&e.aborted)return this;this.setResult({totalTime:h,min:c,max:i,hz:o,period:u,samples:r,mean:d,variance:k,sd:T,sem:_,df:l,critical:N,moe:M,rme:z,p75:S,p99:j,p995:O,p999:A})}if(s){if(this.setResult({error:s}),this.bench.throws)throw s;this.dispatchEvent(a("error",this)),this.bench.dispatchEvent(a("error",this))}return this.dispatchEvent(a("cycle",this)),this.bench.dispatchEvent(a("cycle",this)),this.dispatchEvent(a("complete",this)),this}async warmup(){var t;if((t=this.result)!=null&&t.error)return;this.dispatchEvent(a("warmup",this)),await this.bench.setup(this,"warmup");let{error:e}=await this.loop(this.bench.warmupTime,this.bench.warmupIterations);if(this.bench.teardown(this,"warmup"),e&&(this.setResult({error:e}),this.bench.throws))throw e}addEventListener(t,e,r){super.addEventListener(t,e,r)}removeEventListener(t,e,r){super.removeEventListener(t,e,r)}setResult(t){this.result={...this.result,...t},Object.freeze(this.result)}reset(){this.dispatchEvent(a("reset",this)),this.runs=0,this.result=void 0}},U= exports.Bench =class extends EventTarget{constructor(t={}){var e,r,s,h,u,o,n,l;super(),this._tasks=new Map,this._todos=new Map,this.concurrency=null,this.threshold=1/0,this.warmupTime=100,this.warmupIterations=5,this.time=500,this.iterations=10,this.now=Y,this.now=(e=t.now)!=null?e:this.now,this.warmupTime=(r=t.warmupTime)!=null?r:this.warmupTime,this.warmupIterations=(s=t.warmupIterations)!=null?s:this.warmupIterations,this.time=(h=t.time)!=null?h:this.time,this.iterations=(u=t.iterations)!=null?u:this.iterations,this.signal=t.signal,this.throws=(o=t.throws)!=null?o:!1,this.setup=(n=t.setup)!=null?n:()=>{},this.teardown=(l=t.teardown)!=null?l:()=>{},this.signal&&this.signal.addEventListener("abort",()=>{this.dispatchEvent(a("abort"))},{once:!0})}runTask(t){var e;return(e=this.signal)!=null&&e.aborted?t:t.run()}async run(){if(this.concurrency==="bench")return this.runConcurrently(this.threshold,this.concurrency);this.dispatchEvent(a("start"));let t=[];for(let e of[...this._tasks.values()])t.push(await this.runTask(e));return this.dispatchEvent(a("complete")),t}async runConcurrently(t=1/0,e="bench"){if(this.threshold=t,this.concurrency=e,e==="task")return this.run();this.dispatchEvent(a("start"));let r=g(t),s=[];for(let u of[...this._tasks.values()])s.push(r(()=>this.runTask(u)));let h=await Promise.all(s);return this.dispatchEvent(a("complete")),h}async warmup(){if(this.concurrency==="bench"){await this.warmupConcurrently(this.threshold,this.concurrency);return}this.dispatchEvent(a("warmup"));for(let[,t]of this._tasks)await t.warmup()}async warmupConcurrently(t=1/0,e="bench"){if(this.threshold=t,this.concurrency=e,e==="task"){await this.warmup();return}this.dispatchEvent(a("warmup"));let r=g(t),s=[];for(let[,h]of this._tasks)s.push(r(()=>h.warmup()));await Promise.all(s)}reset(){this.dispatchEvent(a("reset")),this._tasks.forEach(t=>{t.reset()})}add(t,e,r={}){let s=new L(this,t,e,r);return this._tasks.set(t,s),this.dispatchEvent(a("add",s)),this}todo(t,e=()=>{},r={}){let s=new L(this,t,e,r);return this._todos.set(t,s),this.dispatchEvent(a("todo",s)),this}remove(t){let e=this.getTask(t);return e&&(this.dispatchEvent(a("remove",e)),this._tasks.delete(t)),this}addEventListener(t,e,r){super.addEventListener(t,e,r)}removeEventListener(t,e,r){super.removeEventListener(t,e,r)}table(t){return this.tasks.map(e=>{if(e.result){if(e.result.error)throw e.result.error;return _optionalChain([t, 'optionalCall', _2 => _2(e)])||{"Task Name":e.name,"ops/sec":e.result.error?"NaN":parseInt(e.result.hz.toString(),10).toLocaleString(),"Average Time (ns)":e.result.error?"NaN":e.result.mean*1e3*1e3,Margin:e.result.error?"NaN":`\xB1${e.result.rme.toFixed(2)}%`,Samples:e.result.error?"NaN":e.result.samples.length}}return null})}get results(){return[...this._tasks.values()].map(t=>t.result)}get tasks(){return[...this._tasks.values()]}get todos(){return[...this._todos.values()]}getTask(t){return this._tasks.get(t)}};exports.Bench = U; exports.Task = L; exports.hrtimeNow = K; exports.now = Y;
|
|
2
|
+
//# sourceMappingURL=dist-SEGTJ72R.min.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/choksheaklau/src/react-utils/dist/dist-SEGTJ72R.min.cjs","../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.js"],"names":["$","C","s","D","n","t","O","d","k","f","e","F","r","M","m","w","E","g","y","h","p","a","l","i","c","o","G","N","J","U","B","W","S","X","Z","z","b","T","u","v","L","A","P","R","I","_","K","j","H","V","Q","Y","x"],"mappings":"AAAA,inBAAgC,ICA5BA,CAAAA,CAAI,MAAA,CAAO,cAAA,CACXC,CAAAA,CAAKC,CAAAA,EAAM,CACb,MAAM,SAAA,CAAUA,CAAC,CACnB,CAAA,CACIC,CAAAA,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.cjs","sourcesContent":[null,"var $ = Object.defineProperty;\nvar C = (s) => {\n throw TypeError(s);\n};\nvar D = (s, n, t) => n in s ? $(s, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[n] = t;\nvar O = (s, n, t) => D(s, typeof n != \"symbol\" ? n + \"\" : n, t), q = (s, n, t) => n.has(s) || C(\"Cannot \" + t);\nvar d = (s, n, t) => (q(s, n, \"read from private field\"), t ? t.call(s) : n.get(s)), k = (s, n, t) => n.has(s) ? C(\"Cannot add the same private member more than once\") : n instanceof WeakSet ? n.add(s) : n.set(s, t), f = (s, n, t, e) => (q(s, n, \"write to private field\"), e ? e.call(s, t) : n.set(s, t), t);\nvar F = (s, n, t, e) => ({\n set _(r) {\n f(s, n, r, t);\n },\n get _() {\n return d(s, n, e);\n }\n});\n\n// node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js\nvar M = class {\n constructor(n) {\n O(this, \"value\");\n O(this, \"next\");\n this.value = n;\n }\n}, m, w, E, g = class {\n constructor() {\n k(this, m);\n k(this, w);\n k(this, E);\n this.clear();\n }\n enqueue(n) {\n let t = new M(n);\n d(this, m) ? (d(this, w).next = t, f(this, w, t)) : (f(this, m, t), f(this, w, t)), F(this, E)._++;\n }\n dequeue() {\n let n = d(this, m);\n if (n)\n return f(this, m, d(this, m).next), F(this, E)._--, n.value;\n }\n clear() {\n f(this, m, void 0), f(this, w, void 0), f(this, E, 0);\n }\n get size() {\n return d(this, E);\n }\n *[Symbol.iterator]() {\n let n = d(this, m);\n for (; n; )\n yield n.value, n = n.next;\n }\n};\nm = new WeakMap(), w = new WeakMap(), E = new WeakMap();\n\n// node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js\nfunction y(s) {\n if (!((Number.isInteger(s) || s === Number.POSITIVE_INFINITY) && s > 0))\n throw new TypeError(\"Expected `concurrency` to be a number from 1 and up\");\n let n = new g(), t = 0, e = () => {\n t--, n.size > 0 && n.dequeue()();\n }, r = async (h, p, a) => {\n t++;\n let l = (async () => h(...a))();\n p(l);\n try {\n await l;\n } catch (T) {\n }\n e();\n }, i = (h, p, a) => {\n n.enqueue(r.bind(void 0, h, p, a)), (async () => (await Promise.resolve(), t < s && n.size > 0 && n.dequeue()()))();\n }, c = (h, ...p) => new Promise((a) => {\n i(h, a, p);\n });\n return Object.defineProperties(c, {\n activeCount: {\n get: () => t\n },\n pendingCount: {\n get: () => n.size\n },\n clearQueue: {\n value: () => {\n n.clear();\n }\n }\n }), c;\n}\n\n// src/event.ts\nfunction o(s, n = null) {\n let t = new Event(s);\n return n && Object.defineProperty(t, \"task\", {\n value: n,\n enumerable: !0,\n writable: !1,\n configurable: !1\n }), t;\n}\n\n// src/constants.ts\nvar G = {\n 1: 12.71,\n 2: 4.303,\n 3: 3.182,\n 4: 2.776,\n 5: 2.571,\n 6: 2.447,\n 7: 2.365,\n 8: 2.306,\n 9: 2.262,\n 10: 2.228,\n 11: 2.201,\n 12: 2.179,\n 13: 2.16,\n 14: 2.145,\n 15: 2.131,\n 16: 2.12,\n 17: 2.11,\n 18: 2.101,\n 19: 2.093,\n 20: 2.086,\n 21: 2.08,\n 22: 2.074,\n 23: 2.069,\n 24: 2.064,\n 25: 2.06,\n 26: 2.056,\n 27: 2.052,\n 28: 2.048,\n 29: 2.045,\n 30: 2.042,\n 31: 2.0399,\n 32: 2.0378,\n 33: 2.0357,\n 34: 2.0336,\n 35: 2.0315,\n 36: 2.0294,\n 37: 2.0273,\n 38: 2.0252,\n 39: 2.0231,\n 40: 2.021,\n 41: 2.0198,\n 42: 2.0186,\n 43: 2.0174,\n 44: 2.0162,\n 45: 2.015,\n 46: 2.0138,\n 47: 2.0126,\n 48: 2.0114,\n 49: 2.0102,\n 50: 2.009,\n 51: 2.0081,\n 52: 2.0072,\n 53: 2.0063,\n 54: 2.0054,\n 55: 2.0045,\n 56: 2.0036,\n 57: 2.0027,\n 58: 2.0018,\n 59: 2.0009,\n 60: 2,\n 61: 1.9995,\n 62: 1.999,\n 63: 1.9985,\n 64: 1.998,\n 65: 1.9975,\n 66: 1.997,\n 67: 1.9965,\n 68: 1.996,\n 69: 1.9955,\n 70: 1.995,\n 71: 1.9945,\n 72: 1.994,\n 73: 1.9935,\n 74: 1.993,\n 75: 1.9925,\n 76: 1.992,\n 77: 1.9915,\n 78: 1.991,\n 79: 1.9905,\n 80: 1.99,\n 81: 1.9897,\n 82: 1.9894,\n 83: 1.9891,\n 84: 1.9888,\n 85: 1.9885,\n 86: 1.9882,\n 87: 1.9879,\n 88: 1.9876,\n 89: 1.9873,\n 90: 1.987,\n 91: 1.9867,\n 92: 1.9864,\n 93: 1.9861,\n 94: 1.9858,\n 95: 1.9855,\n 96: 1.9852,\n 97: 1.9849,\n 98: 1.9846,\n 99: 1.9843,\n 100: 1.984,\n 101: 1.9838,\n 102: 1.9836,\n 103: 1.9834,\n 104: 1.9832,\n 105: 1.983,\n 106: 1.9828,\n 107: 1.9826,\n 108: 1.9824,\n 109: 1.9822,\n 110: 1.982,\n 111: 1.9818,\n 112: 1.9816,\n 113: 1.9814,\n 114: 1.9812,\n 115: 1.9819,\n 116: 1.9808,\n 117: 1.9806,\n 118: 1.9804,\n 119: 1.9802,\n 120: 1.98,\n infinity: 1.96\n}, N = G;\n\n// src/utils.ts\nvar J = (s) => s / 1e6, U = () => J(Number(process.hrtime.bigint())), B = () => performance.now();\nfunction W(s) {\n return s !== null && typeof s == \"object\" && typeof s.then == \"function\";\n}\nvar S = (s, n) => s.reduce((e, r) => e + (r - n) ** 2, 0) / (s.length - 1) || 0, X = (async () => {\n}).constructor, Z = (s) => s.constructor === X, z = async (s) => {\n if (Z(s.fn))\n return !0;\n try {\n if (s.opts.beforeEach != null)\n try {\n await s.opts.beforeEach.call(s);\n } catch (e) {\n }\n let n = s.fn(), t = W(n);\n if (t)\n try {\n await n;\n } catch (e) {\n }\n if (s.opts.afterEach != null)\n try {\n await s.opts.afterEach.call(s);\n } catch (e) {\n }\n return t;\n } catch (n) {\n return !1;\n }\n};\n\n// src/task.ts\nvar b = class extends EventTarget {\n constructor(t, e, r, i = {}) {\n super();\n /*\n * the number of times the task\n * function has been executed\n */\n this.runs = 0;\n this.bench = t, this.name = e, this.fn = r, this.opts = i;\n }\n async loop(t, e) {\n var T;\n let r = this.bench.concurrency === \"task\", { threshold: i } = this.bench, c = 0, h = [];\n if (this.opts.beforeAll != null)\n try {\n await this.opts.beforeAll.call(this);\n } catch (u) {\n return { error: u };\n }\n let p = await z(this), a = async () => {\n this.opts.beforeEach != null && await this.opts.beforeEach.call(this);\n let u = 0;\n if (p) {\n let v = this.bench.now();\n await this.fn.call(this), u = this.bench.now() - v;\n } else {\n let v = this.bench.now();\n this.fn.call(this), u = this.bench.now() - v;\n }\n h.push(u), c += u, this.opts.afterEach != null && await this.opts.afterEach.call(this);\n }, l = y(i);\n try {\n let u = [];\n for (; (c < t || h.length + l.activeCount + l.pendingCount < e) && !((T = this.bench.signal) != null && T.aborted); )\n r ? u.push(l(a)) : await a();\n u.length && await Promise.all(u);\n } catch (u) {\n return { error: u };\n }\n if (this.opts.afterAll != null)\n try {\n await this.opts.afterAll.call(this);\n } catch (u) {\n return { error: u };\n }\n return { samples: h };\n }\n /**\n * run the current task and write the results in `Task.result` object\n */\n async run() {\n var r, i;\n if ((r = this.result) != null && r.error)\n return this;\n this.dispatchEvent(o(\"start\", this)), await this.bench.setup(this, \"run\");\n let { samples: t, error: e } = await this.loop(this.bench.time, this.bench.iterations);\n if (this.bench.teardown(this, \"run\"), t) {\n let c = t.reduce((L, A) => L + A, 0);\n this.runs = t.length, t.sort((L, A) => L - A);\n let h = c / this.runs, p = 1e3 / h, a = t.length, l = a - 1, T = t[0], u = t[l], v = c / t.length || 0, P = S(t, v), R = Math.sqrt(P), I = R / Math.sqrt(a), _ = N[String(Math.round(l) || 1)] || N.infinity, K = I * _, j = K / v * 100, H = t[Math.ceil(a * 0.75) - 1], V = t[Math.ceil(a * 0.99) - 1], Q = t[Math.ceil(a * 0.995) - 1], Y = t[Math.ceil(a * 0.999) - 1];\n if ((i = this.bench.signal) != null && i.aborted)\n return this;\n this.setResult({\n totalTime: c,\n min: T,\n max: u,\n hz: p,\n period: h,\n samples: t,\n mean: v,\n variance: P,\n sd: R,\n sem: I,\n df: l,\n critical: _,\n moe: K,\n rme: j,\n p75: H,\n p99: V,\n p995: Q,\n p999: Y\n });\n }\n if (e) {\n if (this.setResult({ error: e }), this.bench.throws)\n throw e;\n this.dispatchEvent(o(\"error\", this)), this.bench.dispatchEvent(o(\"error\", this));\n }\n return this.dispatchEvent(o(\"cycle\", this)), this.bench.dispatchEvent(o(\"cycle\", this)), this.dispatchEvent(o(\"complete\", this)), this;\n }\n /**\n * warmup the current task\n */\n async warmup() {\n var e;\n if ((e = this.result) != null && e.error)\n return;\n this.dispatchEvent(o(\"warmup\", this)), await this.bench.setup(this, \"warmup\");\n let { error: t } = await this.loop(this.bench.warmupTime, this.bench.warmupIterations);\n if (this.bench.teardown(this, \"warmup\"), t && (this.setResult({ error: t }), this.bench.throws))\n throw t;\n }\n addEventListener(t, e, r) {\n super.addEventListener(t, e, r);\n }\n removeEventListener(t, e, r) {\n super.removeEventListener(t, e, r);\n }\n /**\n * change the result object values\n */\n setResult(t) {\n this.result = { ...this.result, ...t }, Object.freeze(this.result);\n }\n /**\n * reset the task to make the `Task.runs` a zero-value and remove the `Task.result`\n * object\n */\n reset() {\n this.dispatchEvent(o(\"reset\", this)), this.runs = 0, this.result = void 0;\n }\n};\n\n// src/bench.ts\nvar x = class extends EventTarget {\n constructor(t = {}) {\n var e, r, i, c, h, p, a, l;\n super();\n /*\n * @private the task map\n */\n this._tasks = /* @__PURE__ */ new Map();\n this._todos = /* @__PURE__ */ new Map();\n /**\n * Executes tasks concurrently based on the specified concurrency mode.\n *\n * - When `mode` is set to `null` (default), concurrency is disabled.\n * - When `mode` is set to 'task', each task's iterations (calls of a task function) run concurrently.\n * - When `mode` is set to 'bench', different tasks within the bench run concurrently.\n */\n this.concurrency = null;\n /**\n * The maximum number of concurrent tasks to run. Defaults to Infinity.\n */\n this.threshold = 1 / 0;\n this.warmupTime = 100;\n this.warmupIterations = 5;\n this.time = 500;\n this.iterations = 10;\n this.now = B;\n this.now = (e = t.now) != null ? e : this.now, this.warmupTime = (r = t.warmupTime) != null ? r : this.warmupTime, this.warmupIterations = (i = t.warmupIterations) != null ? i : this.warmupIterations, this.time = (c = t.time) != null ? c : this.time, this.iterations = (h = t.iterations) != null ? h : this.iterations, this.signal = t.signal, this.throws = (p = t.throws) != null ? p : !1, this.setup = (a = t.setup) != null ? a : () => {\n }, this.teardown = (l = t.teardown) != null ? l : () => {\n }, this.signal && this.signal.addEventListener(\n \"abort\",\n () => {\n this.dispatchEvent(o(\"abort\"));\n },\n { once: !0 }\n );\n }\n runTask(t) {\n var e;\n return (e = this.signal) != null && e.aborted ? t : t.run();\n }\n /**\n * run the added tasks that were registered using the\n * {@link add} method.\n * Note: This method does not do any warmup. Call {@link warmup} for that.\n */\n async run() {\n if (this.concurrency === \"bench\")\n return this.runConcurrently(this.threshold, this.concurrency);\n this.dispatchEvent(o(\"start\"));\n let t = [];\n for (let e of [...this._tasks.values()])\n t.push(await this.runTask(e));\n return this.dispatchEvent(o(\"complete\")), t;\n }\n /**\n * See Bench.{@link concurrency}\n */\n async runConcurrently(t = 1 / 0, e = \"bench\") {\n if (this.threshold = t, this.concurrency = e, e === \"task\")\n return this.run();\n this.dispatchEvent(o(\"start\"));\n let r = y(t), i = [];\n for (let h of [...this._tasks.values()])\n i.push(r(() => this.runTask(h)));\n let c = await Promise.all(i);\n return this.dispatchEvent(o(\"complete\")), c;\n }\n /**\n * warmup the benchmark tasks.\n * This is not run by default by the {@link run} method.\n */\n async warmup() {\n if (this.concurrency === \"bench\") {\n await this.warmupConcurrently(this.threshold, this.concurrency);\n return;\n }\n this.dispatchEvent(o(\"warmup\"));\n for (let [, t] of this._tasks)\n await t.warmup();\n }\n /**\n * warmup the benchmark tasks concurrently.\n * This is not run by default by the {@link runConcurrently} method.\n */\n async warmupConcurrently(t = 1 / 0, e = \"bench\") {\n if (this.threshold = t, this.concurrency = e, e === \"task\") {\n await this.warmup();\n return;\n }\n this.dispatchEvent(o(\"warmup\"));\n let r = y(t), i = [];\n for (let [, c] of this._tasks)\n i.push(r(() => c.warmup()));\n await Promise.all(i);\n }\n /**\n * reset each task and remove its result\n */\n reset() {\n this.dispatchEvent(o(\"reset\")), this._tasks.forEach((t) => {\n t.reset();\n });\n }\n /**\n * add a benchmark task to the task map\n */\n add(t, e, r = {}) {\n let i = new b(this, t, e, r);\n return this._tasks.set(t, i), this.dispatchEvent(o(\"add\", i)), this;\n }\n /**\n * add a benchmark todo to the todo map\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n todo(t, e = () => {\n }, r = {}) {\n let i = new b(this, t, e, r);\n return this._todos.set(t, i), this.dispatchEvent(o(\"todo\", i)), this;\n }\n /**\n * remove a benchmark task from the task map\n */\n remove(t) {\n let e = this.getTask(t);\n return e && (this.dispatchEvent(o(\"remove\", e)), this._tasks.delete(t)), this;\n }\n addEventListener(t, e, r) {\n super.addEventListener(t, e, r);\n }\n removeEventListener(t, e, r) {\n super.removeEventListener(t, e, r);\n }\n /**\n * table of the tasks results\n */\n table(t) {\n return this.tasks.map((e) => {\n if (e.result) {\n if (e.result.error)\n throw e.result.error;\n return (t == null ? void 0 : t(e)) || {\n \"Task Name\": e.name,\n \"ops/sec\": e.result.error ? \"NaN\" : parseInt(e.result.hz.toString(), 10).toLocaleString(),\n \"Average Time (ns)\": e.result.error ? \"NaN\" : e.result.mean * 1e3 * 1e3,\n Margin: e.result.error ? \"NaN\" : `\\xB1${e.result.rme.toFixed(2)}%`,\n Samples: e.result.error ? \"NaN\" : e.result.samples.length\n };\n }\n return null;\n });\n }\n /**\n * (getter) tasks results as an array\n */\n get results() {\n return [...this._tasks.values()].map((t) => t.result);\n }\n /**\n * (getter) tasks as an array\n */\n get tasks() {\n return [...this._tasks.values()];\n }\n get todos() {\n return [...this._todos.values()];\n }\n /**\n * get a task based on the task name\n */\n getTask(t) {\n return this._tasks.get(t);\n }\n};\nexport {\n x as Bench,\n b as Task,\n U as hrtimeNow,\n B as now\n};\n"]}
|
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-IS3BZTWE.cjs');
|
|
2
|
+
|
|
3
|
+
// node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.js
|
|
4
|
+
var $ = Object.defineProperty;
|
|
5
|
+
var C = (s) => {
|
|
6
|
+
throw TypeError(s);
|
|
7
|
+
};
|
|
8
|
+
var D = (s, n, t) => n in s ? $(s, n, { enumerable: true, configurable: true, writable: true, value: t }) : s[n] = t;
|
|
9
|
+
var O = (s, n, t) => D(s, typeof n != "symbol" ? n + "" : n, t);
|
|
10
|
+
var q = (s, n, t) => n.has(s) || C("Cannot " + t);
|
|
11
|
+
var d = (s, n, t) => (q(s, n, "read from private field"), t ? t.call(s) : n.get(s));
|
|
12
|
+
var k = (s, n, t) => n.has(s) ? C("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(s) : n.set(s, t);
|
|
13
|
+
var f = (s, n, t, e) => (q(s, n, "write to private field"), e ? e.call(s, t) : n.set(s, t), t);
|
|
14
|
+
var F = (s, n, t, e) => ({
|
|
15
|
+
set _(r) {
|
|
16
|
+
f(s, n, r, t);
|
|
17
|
+
},
|
|
18
|
+
get _() {
|
|
19
|
+
return d(s, n, e);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var M = class {
|
|
23
|
+
constructor(n) {
|
|
24
|
+
O(this, "value");
|
|
25
|
+
O(this, "next");
|
|
26
|
+
this.value = n;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var m;
|
|
30
|
+
var w;
|
|
31
|
+
var E;
|
|
32
|
+
var g = class {
|
|
33
|
+
constructor() {
|
|
34
|
+
k(this, m);
|
|
35
|
+
k(this, w);
|
|
36
|
+
k(this, E);
|
|
37
|
+
this.clear();
|
|
38
|
+
}
|
|
39
|
+
enqueue(n) {
|
|
40
|
+
let t = new M(n);
|
|
41
|
+
d(this, m) ? (d(this, w).next = t, f(this, w, t)) : (f(this, m, t), f(this, w, t)), F(this, E)._++;
|
|
42
|
+
}
|
|
43
|
+
dequeue() {
|
|
44
|
+
let n = d(this, m);
|
|
45
|
+
if (n)
|
|
46
|
+
return f(this, m, d(this, m).next), F(this, E)._--, n.value;
|
|
47
|
+
}
|
|
48
|
+
clear() {
|
|
49
|
+
f(this, m, void 0), f(this, w, void 0), f(this, E, 0);
|
|
50
|
+
}
|
|
51
|
+
get size() {
|
|
52
|
+
return d(this, E);
|
|
53
|
+
}
|
|
54
|
+
*[Symbol.iterator]() {
|
|
55
|
+
let n = d(this, m);
|
|
56
|
+
for (; n; )
|
|
57
|
+
yield n.value, n = n.next;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
m = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap();
|
|
61
|
+
function y(s) {
|
|
62
|
+
if (!((Number.isInteger(s) || s === Number.POSITIVE_INFINITY) && s > 0))
|
|
63
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
64
|
+
let n = new g(), t = 0, e = () => {
|
|
65
|
+
t--, n.size > 0 && n.dequeue()();
|
|
66
|
+
}, r = async (h, p, a) => {
|
|
67
|
+
t++;
|
|
68
|
+
let l = (async () => h(...a))();
|
|
69
|
+
p(l);
|
|
70
|
+
try {
|
|
71
|
+
await l;
|
|
72
|
+
} catch (T) {
|
|
73
|
+
}
|
|
74
|
+
e();
|
|
75
|
+
}, i = (h, p, a) => {
|
|
76
|
+
n.enqueue(r.bind(void 0, h, p, a)), (async () => (await Promise.resolve(), t < s && n.size > 0 && n.dequeue()()))();
|
|
77
|
+
}, c = (h, ...p) => new Promise((a) => {
|
|
78
|
+
i(h, a, p);
|
|
79
|
+
});
|
|
80
|
+
return Object.defineProperties(c, {
|
|
81
|
+
activeCount: {
|
|
82
|
+
get: () => t
|
|
83
|
+
},
|
|
84
|
+
pendingCount: {
|
|
85
|
+
get: () => n.size
|
|
86
|
+
},
|
|
87
|
+
clearQueue: {
|
|
88
|
+
value: () => {
|
|
89
|
+
n.clear();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}), c;
|
|
93
|
+
}
|
|
94
|
+
function o(s, n = null) {
|
|
95
|
+
let t = new Event(s);
|
|
96
|
+
return n && Object.defineProperty(t, "task", {
|
|
97
|
+
value: n,
|
|
98
|
+
enumerable: true,
|
|
99
|
+
writable: false,
|
|
100
|
+
configurable: false
|
|
101
|
+
}), t;
|
|
102
|
+
}
|
|
103
|
+
var G = {
|
|
104
|
+
1: 12.71,
|
|
105
|
+
2: 4.303,
|
|
106
|
+
3: 3.182,
|
|
107
|
+
4: 2.776,
|
|
108
|
+
5: 2.571,
|
|
109
|
+
6: 2.447,
|
|
110
|
+
7: 2.365,
|
|
111
|
+
8: 2.306,
|
|
112
|
+
9: 2.262,
|
|
113
|
+
10: 2.228,
|
|
114
|
+
11: 2.201,
|
|
115
|
+
12: 2.179,
|
|
116
|
+
13: 2.16,
|
|
117
|
+
14: 2.145,
|
|
118
|
+
15: 2.131,
|
|
119
|
+
16: 2.12,
|
|
120
|
+
17: 2.11,
|
|
121
|
+
18: 2.101,
|
|
122
|
+
19: 2.093,
|
|
123
|
+
20: 2.086,
|
|
124
|
+
21: 2.08,
|
|
125
|
+
22: 2.074,
|
|
126
|
+
23: 2.069,
|
|
127
|
+
24: 2.064,
|
|
128
|
+
25: 2.06,
|
|
129
|
+
26: 2.056,
|
|
130
|
+
27: 2.052,
|
|
131
|
+
28: 2.048,
|
|
132
|
+
29: 2.045,
|
|
133
|
+
30: 2.042,
|
|
134
|
+
31: 2.0399,
|
|
135
|
+
32: 2.0378,
|
|
136
|
+
33: 2.0357,
|
|
137
|
+
34: 2.0336,
|
|
138
|
+
35: 2.0315,
|
|
139
|
+
36: 2.0294,
|
|
140
|
+
37: 2.0273,
|
|
141
|
+
38: 2.0252,
|
|
142
|
+
39: 2.0231,
|
|
143
|
+
40: 2.021,
|
|
144
|
+
41: 2.0198,
|
|
145
|
+
42: 2.0186,
|
|
146
|
+
43: 2.0174,
|
|
147
|
+
44: 2.0162,
|
|
148
|
+
45: 2.015,
|
|
149
|
+
46: 2.0138,
|
|
150
|
+
47: 2.0126,
|
|
151
|
+
48: 2.0114,
|
|
152
|
+
49: 2.0102,
|
|
153
|
+
50: 2.009,
|
|
154
|
+
51: 2.0081,
|
|
155
|
+
52: 2.0072,
|
|
156
|
+
53: 2.0063,
|
|
157
|
+
54: 2.0054,
|
|
158
|
+
55: 2.0045,
|
|
159
|
+
56: 2.0036,
|
|
160
|
+
57: 2.0027,
|
|
161
|
+
58: 2.0018,
|
|
162
|
+
59: 2.0009,
|
|
163
|
+
60: 2,
|
|
164
|
+
61: 1.9995,
|
|
165
|
+
62: 1.999,
|
|
166
|
+
63: 1.9985,
|
|
167
|
+
64: 1.998,
|
|
168
|
+
65: 1.9975,
|
|
169
|
+
66: 1.997,
|
|
170
|
+
67: 1.9965,
|
|
171
|
+
68: 1.996,
|
|
172
|
+
69: 1.9955,
|
|
173
|
+
70: 1.995,
|
|
174
|
+
71: 1.9945,
|
|
175
|
+
72: 1.994,
|
|
176
|
+
73: 1.9935,
|
|
177
|
+
74: 1.993,
|
|
178
|
+
75: 1.9925,
|
|
179
|
+
76: 1.992,
|
|
180
|
+
77: 1.9915,
|
|
181
|
+
78: 1.991,
|
|
182
|
+
79: 1.9905,
|
|
183
|
+
80: 1.99,
|
|
184
|
+
81: 1.9897,
|
|
185
|
+
82: 1.9894,
|
|
186
|
+
83: 1.9891,
|
|
187
|
+
84: 1.9888,
|
|
188
|
+
85: 1.9885,
|
|
189
|
+
86: 1.9882,
|
|
190
|
+
87: 1.9879,
|
|
191
|
+
88: 1.9876,
|
|
192
|
+
89: 1.9873,
|
|
193
|
+
90: 1.987,
|
|
194
|
+
91: 1.9867,
|
|
195
|
+
92: 1.9864,
|
|
196
|
+
93: 1.9861,
|
|
197
|
+
94: 1.9858,
|
|
198
|
+
95: 1.9855,
|
|
199
|
+
96: 1.9852,
|
|
200
|
+
97: 1.9849,
|
|
201
|
+
98: 1.9846,
|
|
202
|
+
99: 1.9843,
|
|
203
|
+
100: 1.984,
|
|
204
|
+
101: 1.9838,
|
|
205
|
+
102: 1.9836,
|
|
206
|
+
103: 1.9834,
|
|
207
|
+
104: 1.9832,
|
|
208
|
+
105: 1.983,
|
|
209
|
+
106: 1.9828,
|
|
210
|
+
107: 1.9826,
|
|
211
|
+
108: 1.9824,
|
|
212
|
+
109: 1.9822,
|
|
213
|
+
110: 1.982,
|
|
214
|
+
111: 1.9818,
|
|
215
|
+
112: 1.9816,
|
|
216
|
+
113: 1.9814,
|
|
217
|
+
114: 1.9812,
|
|
218
|
+
115: 1.9819,
|
|
219
|
+
116: 1.9808,
|
|
220
|
+
117: 1.9806,
|
|
221
|
+
118: 1.9804,
|
|
222
|
+
119: 1.9802,
|
|
223
|
+
120: 1.98,
|
|
224
|
+
infinity: 1.96
|
|
225
|
+
};
|
|
226
|
+
var N = G;
|
|
227
|
+
var J = (s) => s / 1e6;
|
|
228
|
+
var U = () => J(Number(process.hrtime.bigint()));
|
|
229
|
+
var B = () => performance.now();
|
|
230
|
+
function W(s) {
|
|
231
|
+
return s !== null && typeof s == "object" && typeof s.then == "function";
|
|
232
|
+
}
|
|
233
|
+
var S = (s, n) => s.reduce((e, r) => e + (r - n) ** 2, 0) / (s.length - 1) || 0;
|
|
234
|
+
var X = (async () => {
|
|
235
|
+
}).constructor;
|
|
236
|
+
var Z = (s) => s.constructor === X;
|
|
237
|
+
var z = async (s) => {
|
|
238
|
+
if (Z(s.fn))
|
|
239
|
+
return true;
|
|
240
|
+
try {
|
|
241
|
+
if (s.opts.beforeEach != null)
|
|
242
|
+
try {
|
|
243
|
+
await s.opts.beforeEach.call(s);
|
|
244
|
+
} catch (e) {
|
|
245
|
+
}
|
|
246
|
+
let n = s.fn(), t = W(n);
|
|
247
|
+
if (t)
|
|
248
|
+
try {
|
|
249
|
+
await n;
|
|
250
|
+
} catch (e) {
|
|
251
|
+
}
|
|
252
|
+
if (s.opts.afterEach != null)
|
|
253
|
+
try {
|
|
254
|
+
await s.opts.afterEach.call(s);
|
|
255
|
+
} catch (e) {
|
|
256
|
+
}
|
|
257
|
+
return t;
|
|
258
|
+
} catch (n) {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
var b = class extends EventTarget {
|
|
263
|
+
constructor(t, e, r, i = {}) {
|
|
264
|
+
super();
|
|
265
|
+
this.runs = 0;
|
|
266
|
+
this.bench = t, this.name = e, this.fn = r, this.opts = i;
|
|
267
|
+
}
|
|
268
|
+
async loop(t, e) {
|
|
269
|
+
var T;
|
|
270
|
+
let r = this.bench.concurrency === "task", { threshold: i } = this.bench, c = 0, h = [];
|
|
271
|
+
if (this.opts.beforeAll != null)
|
|
272
|
+
try {
|
|
273
|
+
await this.opts.beforeAll.call(this);
|
|
274
|
+
} catch (u) {
|
|
275
|
+
return { error: u };
|
|
276
|
+
}
|
|
277
|
+
let p = await z(this), a = async () => {
|
|
278
|
+
this.opts.beforeEach != null && await this.opts.beforeEach.call(this);
|
|
279
|
+
let u = 0;
|
|
280
|
+
if (p) {
|
|
281
|
+
let v = this.bench.now();
|
|
282
|
+
await this.fn.call(this), u = this.bench.now() - v;
|
|
283
|
+
} else {
|
|
284
|
+
let v = this.bench.now();
|
|
285
|
+
this.fn.call(this), u = this.bench.now() - v;
|
|
286
|
+
}
|
|
287
|
+
h.push(u), c += u, this.opts.afterEach != null && await this.opts.afterEach.call(this);
|
|
288
|
+
}, l = y(i);
|
|
289
|
+
try {
|
|
290
|
+
let u = [];
|
|
291
|
+
for (; (c < t || h.length + l.activeCount + l.pendingCount < e) && !((T = this.bench.signal) != null && T.aborted); )
|
|
292
|
+
r ? u.push(l(a)) : await a();
|
|
293
|
+
u.length && await Promise.all(u);
|
|
294
|
+
} catch (u) {
|
|
295
|
+
return { error: u };
|
|
296
|
+
}
|
|
297
|
+
if (this.opts.afterAll != null)
|
|
298
|
+
try {
|
|
299
|
+
await this.opts.afterAll.call(this);
|
|
300
|
+
} catch (u) {
|
|
301
|
+
return { error: u };
|
|
302
|
+
}
|
|
303
|
+
return { samples: h };
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* run the current task and write the results in `Task.result` object
|
|
307
|
+
*/
|
|
308
|
+
async run() {
|
|
309
|
+
var r, i;
|
|
310
|
+
if ((r = this.result) != null && r.error)
|
|
311
|
+
return this;
|
|
312
|
+
this.dispatchEvent(o("start", this)), await this.bench.setup(this, "run");
|
|
313
|
+
let { samples: t, error: e } = await this.loop(this.bench.time, this.bench.iterations);
|
|
314
|
+
if (this.bench.teardown(this, "run"), t) {
|
|
315
|
+
let c = t.reduce((L, A) => L + A, 0);
|
|
316
|
+
this.runs = t.length, t.sort((L, A) => L - A);
|
|
317
|
+
let h = c / this.runs, p = 1e3 / h, a = t.length, l = a - 1, T = t[0], u = t[l], v = c / t.length || 0, P = S(t, v), R = Math.sqrt(P), I = R / Math.sqrt(a), _ = N[String(Math.round(l) || 1)] || N.infinity, K = I * _, j = K / v * 100, H = t[Math.ceil(a * 0.75) - 1], V = t[Math.ceil(a * 0.99) - 1], Q = t[Math.ceil(a * 0.995) - 1], Y = t[Math.ceil(a * 0.999) - 1];
|
|
318
|
+
if ((i = this.bench.signal) != null && i.aborted)
|
|
319
|
+
return this;
|
|
320
|
+
this.setResult({
|
|
321
|
+
totalTime: c,
|
|
322
|
+
min: T,
|
|
323
|
+
max: u,
|
|
324
|
+
hz: p,
|
|
325
|
+
period: h,
|
|
326
|
+
samples: t,
|
|
327
|
+
mean: v,
|
|
328
|
+
variance: P,
|
|
329
|
+
sd: R,
|
|
330
|
+
sem: I,
|
|
331
|
+
df: l,
|
|
332
|
+
critical: _,
|
|
333
|
+
moe: K,
|
|
334
|
+
rme: j,
|
|
335
|
+
p75: H,
|
|
336
|
+
p99: V,
|
|
337
|
+
p995: Q,
|
|
338
|
+
p999: Y
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
if (e) {
|
|
342
|
+
if (this.setResult({ error: e }), this.bench.throws)
|
|
343
|
+
throw e;
|
|
344
|
+
this.dispatchEvent(o("error", this)), this.bench.dispatchEvent(o("error", this));
|
|
345
|
+
}
|
|
346
|
+
return this.dispatchEvent(o("cycle", this)), this.bench.dispatchEvent(o("cycle", this)), this.dispatchEvent(o("complete", this)), this;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* warmup the current task
|
|
350
|
+
*/
|
|
351
|
+
async warmup() {
|
|
352
|
+
var e;
|
|
353
|
+
if ((e = this.result) != null && e.error)
|
|
354
|
+
return;
|
|
355
|
+
this.dispatchEvent(o("warmup", this)), await this.bench.setup(this, "warmup");
|
|
356
|
+
let { error: t } = await this.loop(this.bench.warmupTime, this.bench.warmupIterations);
|
|
357
|
+
if (this.bench.teardown(this, "warmup"), t && (this.setResult({ error: t }), this.bench.throws))
|
|
358
|
+
throw t;
|
|
359
|
+
}
|
|
360
|
+
addEventListener(t, e, r) {
|
|
361
|
+
super.addEventListener(t, e, r);
|
|
362
|
+
}
|
|
363
|
+
removeEventListener(t, e, r) {
|
|
364
|
+
super.removeEventListener(t, e, r);
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* change the result object values
|
|
368
|
+
*/
|
|
369
|
+
setResult(t) {
|
|
370
|
+
this.result = { ...this.result, ...t }, Object.freeze(this.result);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* reset the task to make the `Task.runs` a zero-value and remove the `Task.result`
|
|
374
|
+
* object
|
|
375
|
+
*/
|
|
376
|
+
reset() {
|
|
377
|
+
this.dispatchEvent(o("reset", this)), this.runs = 0, this.result = void 0;
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
var x = class extends EventTarget {
|
|
381
|
+
constructor(t = {}) {
|
|
382
|
+
var e, r, i, c, h, p, a, l;
|
|
383
|
+
super();
|
|
384
|
+
this._tasks = /* @__PURE__ */ new Map();
|
|
385
|
+
this._todos = /* @__PURE__ */ new Map();
|
|
386
|
+
this.concurrency = null;
|
|
387
|
+
this.threshold = 1 / 0;
|
|
388
|
+
this.warmupTime = 100;
|
|
389
|
+
this.warmupIterations = 5;
|
|
390
|
+
this.time = 500;
|
|
391
|
+
this.iterations = 10;
|
|
392
|
+
this.now = B;
|
|
393
|
+
this.now = (e = t.now) != null ? e : this.now, this.warmupTime = (r = t.warmupTime) != null ? r : this.warmupTime, this.warmupIterations = (i = t.warmupIterations) != null ? i : this.warmupIterations, this.time = (c = t.time) != null ? c : this.time, this.iterations = (h = t.iterations) != null ? h : this.iterations, this.signal = t.signal, this.throws = (p = t.throws) != null ? p : false, this.setup = (a = t.setup) != null ? a : () => {
|
|
394
|
+
}, this.teardown = (l = t.teardown) != null ? l : () => {
|
|
395
|
+
}, this.signal && this.signal.addEventListener(
|
|
396
|
+
"abort",
|
|
397
|
+
() => {
|
|
398
|
+
this.dispatchEvent(o("abort"));
|
|
399
|
+
},
|
|
400
|
+
{ once: true }
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
runTask(t) {
|
|
404
|
+
var e;
|
|
405
|
+
return (e = this.signal) != null && e.aborted ? t : t.run();
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* run the added tasks that were registered using the
|
|
409
|
+
* {@link add} method.
|
|
410
|
+
* Note: This method does not do any warmup. Call {@link warmup} for that.
|
|
411
|
+
*/
|
|
412
|
+
async run() {
|
|
413
|
+
if (this.concurrency === "bench")
|
|
414
|
+
return this.runConcurrently(this.threshold, this.concurrency);
|
|
415
|
+
this.dispatchEvent(o("start"));
|
|
416
|
+
let t = [];
|
|
417
|
+
for (let e of [...this._tasks.values()])
|
|
418
|
+
t.push(await this.runTask(e));
|
|
419
|
+
return this.dispatchEvent(o("complete")), t;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* See Bench.{@link concurrency}
|
|
423
|
+
*/
|
|
424
|
+
async runConcurrently(t = 1 / 0, e = "bench") {
|
|
425
|
+
if (this.threshold = t, this.concurrency = e, e === "task")
|
|
426
|
+
return this.run();
|
|
427
|
+
this.dispatchEvent(o("start"));
|
|
428
|
+
let r = y(t), i = [];
|
|
429
|
+
for (let h of [...this._tasks.values()])
|
|
430
|
+
i.push(r(() => this.runTask(h)));
|
|
431
|
+
let c = await Promise.all(i);
|
|
432
|
+
return this.dispatchEvent(o("complete")), c;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* warmup the benchmark tasks.
|
|
436
|
+
* This is not run by default by the {@link run} method.
|
|
437
|
+
*/
|
|
438
|
+
async warmup() {
|
|
439
|
+
if (this.concurrency === "bench") {
|
|
440
|
+
await this.warmupConcurrently(this.threshold, this.concurrency);
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
this.dispatchEvent(o("warmup"));
|
|
444
|
+
for (let [, t] of this._tasks)
|
|
445
|
+
await t.warmup();
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* warmup the benchmark tasks concurrently.
|
|
449
|
+
* This is not run by default by the {@link runConcurrently} method.
|
|
450
|
+
*/
|
|
451
|
+
async warmupConcurrently(t = 1 / 0, e = "bench") {
|
|
452
|
+
if (this.threshold = t, this.concurrency = e, e === "task") {
|
|
453
|
+
await this.warmup();
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
this.dispatchEvent(o("warmup"));
|
|
457
|
+
let r = y(t), i = [];
|
|
458
|
+
for (let [, c] of this._tasks)
|
|
459
|
+
i.push(r(() => c.warmup()));
|
|
460
|
+
await Promise.all(i);
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* reset each task and remove its result
|
|
464
|
+
*/
|
|
465
|
+
reset() {
|
|
466
|
+
this.dispatchEvent(o("reset")), this._tasks.forEach((t) => {
|
|
467
|
+
t.reset();
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* add a benchmark task to the task map
|
|
472
|
+
*/
|
|
473
|
+
add(t, e, r = {}) {
|
|
474
|
+
let i = new b(this, t, e, r);
|
|
475
|
+
return this._tasks.set(t, i), this.dispatchEvent(o("add", i)), this;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* add a benchmark todo to the todo map
|
|
479
|
+
*/
|
|
480
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
481
|
+
todo(t, e = () => {
|
|
482
|
+
}, r = {}) {
|
|
483
|
+
let i = new b(this, t, e, r);
|
|
484
|
+
return this._todos.set(t, i), this.dispatchEvent(o("todo", i)), this;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* remove a benchmark task from the task map
|
|
488
|
+
*/
|
|
489
|
+
remove(t) {
|
|
490
|
+
let e = this.getTask(t);
|
|
491
|
+
return e && (this.dispatchEvent(o("remove", e)), this._tasks.delete(t)), this;
|
|
492
|
+
}
|
|
493
|
+
addEventListener(t, e, r) {
|
|
494
|
+
super.addEventListener(t, e, r);
|
|
495
|
+
}
|
|
496
|
+
removeEventListener(t, e, r) {
|
|
497
|
+
super.removeEventListener(t, e, r);
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* table of the tasks results
|
|
501
|
+
*/
|
|
502
|
+
table(t) {
|
|
503
|
+
return this.tasks.map((e) => {
|
|
504
|
+
if (e.result) {
|
|
505
|
+
if (e.result.error)
|
|
506
|
+
throw e.result.error;
|
|
507
|
+
return (t == null ? void 0 : t(e)) || {
|
|
508
|
+
"Task Name": e.name,
|
|
509
|
+
"ops/sec": e.result.error ? "NaN" : parseInt(e.result.hz.toString(), 10).toLocaleString(),
|
|
510
|
+
"Average Time (ns)": e.result.error ? "NaN" : e.result.mean * 1e3 * 1e3,
|
|
511
|
+
Margin: e.result.error ? "NaN" : `\xB1${e.result.rme.toFixed(2)}%`,
|
|
512
|
+
Samples: e.result.error ? "NaN" : e.result.samples.length
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
return null;
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* (getter) tasks results as an array
|
|
520
|
+
*/
|
|
521
|
+
get results() {
|
|
522
|
+
return [...this._tasks.values()].map((t) => t.result);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* (getter) tasks as an array
|
|
526
|
+
*/
|
|
527
|
+
get tasks() {
|
|
528
|
+
return [...this._tasks.values()];
|
|
529
|
+
}
|
|
530
|
+
get todos() {
|
|
531
|
+
return [...this._todos.values()];
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* get a task based on the task name
|
|
535
|
+
*/
|
|
536
|
+
getTask(t) {
|
|
537
|
+
return this._tasks.get(t);
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
exports.Bench = x; exports.Task = b; exports.hrtimeNow = U; exports.now = B;
|