Skip to content

Instantly share code, notes, and snippets.

@JobLeonard
Last active April 17, 2023 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JobLeonard/5e556759c93d2d8873c4bf1561c997a5 to your computer and use it in GitHub Desktop.
Save JobLeonard/5e556759c93d2d8873c4bf1561c997a5 to your computer and use it in GitHub Desktop.
Fast skip test
{"title":"Fast skip test","initialization":"class BitArray {\n /** @param {number} length */\n constructor(length) {\n this.bits = new Uint32Array(Math.ceil(length >>> 5));\n this.bits8 = new Uint8Array(this.bits.buffer);\n this.length = length;\n }\n\n /** @param {boolean} bool */\n fill(bool) {\n this.bits.fill(bool ? 0xFFFFFFFF : 0);\n }\n\n /** @param {number} i */\n set(i, tf = true) {\n if (!tf) return this.unset(i);\n this.bits[i >>> 5] |= 1 << (i & 31);\n }\n\n /** @param {number} i */\n unset(i) {\n this.bits[i >>> 5] &= ~(1 << (i & 31));\n }\n\n /** @param {number} i */\n at(i) {\n return !!(this.bits[i >>> 5] & 1 << (i & 31));\n }\n\n /** @param {number} newLength */\n resize(newLength) {\n if (newLength < 0 || !Number.isInteger(newLength))\n throw new Error(\"new size must be a positive integer\");\n if (newLength !== this.length) {\n const _length = Math.ceil(newLength >>> 5);\n const _bits = new Uint32Array(_length);\n _bits.set(newLength < this.length ? this.bits.subarray(0, newLength) : this.bits);\n this.bits = _bits;\n this.length = newLength;\n }\n }\n\n [Symbol.iterator]() {\n let i = 0;\n const {bits, length} = this;\n return {\n next() {\n if (i < length) {\n const ret = {\n done: false,\n value: bits[i >>> 5] & 1 << (i & 31) ? true : false\n };\n i++;\n return ret;\n }\n return {done: true, value: undefined};\n }\n };\n }\n}\n\nrowGroupSize = 1000000;\n\nconst emptyRows1 = new BitArray(rowGroupSize);\nconst emptyRows2 = new BitArray(rowGroupSize);\nconst emptyRows3 = new BitArray(rowGroupSize);\nconst controlEmpty = new BitArray(rowGroupSize);\ncontrolEmpty.fill(true);\nconst map = new Uint32Array(rowGroupSize);\n\nconst randomize = () => {\n emptyRows1.fill(true);\n emptyRows2.fill(true);\n emptyRows3.fill(true);\n const {random} = Math;\n\n for (let i = 0; i < rowGroupSize; i++) {\n if (random() < 1/8) emptyRows1.unset(i);\n }\n\n for (let i = 0; i < rowGroupSize; i++) {\n if (random() < 1/32) emptyRows2.unset(i)\n }\n\n for (let i = 0; i < rowGroupSize; i++) {\n if (random() < 1/256) emptyRows3.unset(i)\n }\n};\n\nrandomize();\nconsole.log({emptyRows1, emptyRows2, emptyRows3, controlEmpty});","setup":"randomize();","tests":[{"name":"plain .at, 1 : 8 ratio","code":"let row = 0;\nfor (let ri = 0; ri < rowGroupSize; ++ri) {\n if (!emptyRows1.at(ri)) {\n map[row] = ri;\n row += 1;\n }\n}","results":{"aborted":false,"count":32,"cycles":4,"hz":405.17910386799,"stats":{"moe":0.00002066537973322203,"rme":0.8373180041398625,"sem":0.000010543561088378586,"deviation":0.00006668333537680041,"mean":0.0024680443548387096,"variance":4.446667216974842e-9,"numSamples":40},"times":{"cycle":0.07897741935483871,"elapsed":6.336,"period":0.0024680443548387096,"timeStamp":1681769787326}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":21,"cycles":3,"hz":247.7698585851349,"stats":{"moe":0.00009444857888325406,"rme":2.3401511033470817,"sem":0.000046252976926177314,"deviation":0.0002575256766043693,"mean":0.004036003433631518,"variance":6.63194741105382e-8,"numSamples":31},"times":{"cycle":0.08475607210626188,"elapsed":6.285,"period":0.004036003433631518,"timeStamp":1681769659094}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":32,"cycles":4,"hz":405.17910386799,"stats":{"moe":0.00002066537973322203,"rme":0.8373180041398625,"sem":0.000010543561088378586,"deviation":0.00006668333537680041,"mean":0.0024680443548387096,"variance":4.446667216974842e-9,"numSamples":40},"times":{"cycle":0.07897741935483871,"elapsed":6.336,"period":0.0024680443548387096,"timeStamp":1681769787326}}}},{"name":"plain .at, 1 : 32 ratio","code":"let row = 0;\nfor (let ri = 0; ri < rowGroupSize; ++ri) {\n if (!emptyRows2.at(ri)) {\n map[row] = ri;\n row += 1;\n }\n}","results":{"aborted":false,"count":47,"cycles":3,"hz":592.3440247846215,"stats":{"moe":0.000037360877011065456,"rme":2.2130492258217753,"sem":0.00001906167194442115,"deviation":0.000119040103139037,"mean":0.0016882081327039698,"variance":1.4170546155352567e-8,"numSamples":39},"times":{"cycle":0.07934578223708658,"elapsed":6.271,"period":0.0016882081327039698,"timeStamp":1681769793669}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":32,"cycles":3,"hz":355.56402394384725,"stats":{"moe":0.0000967553850146951,"rme":3.440273403406121,"sem":0.00004936499235443627,"deviation":0.000287844895708124,"mean":0.002812433015320824,"variance":8.285468398522077e-8,"numSamples":34},"times":{"cycle":0.08999785649026637,"elapsed":8.032,"period":0.002812433015320824,"timeStamp":1681769665386}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":47,"cycles":3,"hz":592.3440247846215,"stats":{"moe":0.000037360877011065456,"rme":2.2130492258217753,"sem":0.00001906167194442115,"deviation":0.000119040103139037,"mean":0.0016882081327039698,"variance":1.4170546155352567e-8,"numSamples":39},"times":{"cycle":0.07934578223708658,"elapsed":6.271,"period":0.0016882081327039698,"timeStamp":1681769793669}}}},{"name":"plain .at, 1 : 256 ratio","code":"let row = 0;\nfor (let ri = 0; ri < rowGroupSize; ++ri) {\n if (!emptyRows3.at(ri)) {\n map[row] = ri;\n row += 1;\n }\n}","results":{"aborted":false,"count":54,"cycles":5,"hz":695.3986332574033,"stats":{"moe":0.00004139893096142509,"rme":2.87887600088926,"sem":0.000021121903551747494,"deviation":0.0001335866474838445,"mean":0.0014380241090146749,"variance":1.7845392385972937e-8,"numSamples":40},"times":{"cycle":0.07765330188679244,"elapsed":6.437,"period":0.0014380241090146749,"timeStamp":1681769799949}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":37,"cycles":4,"hz":387.05820817454986,"stats":{"moe":0.00014309295680402752,"rme":5.538530346296516,"sem":0.00006714826691883038,"deviation":0.00026859306767532153,"mean":0.002583590733590733,"variance":7.214223600323984e-8,"numSamples":16},"times":{"cycle":0.09559285714285712,"elapsed":8.369,"period":0.002583590733590733,"timeStamp":1681769673424}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":54,"cycles":5,"hz":695.3986332574033,"stats":{"moe":0.00004139893096142509,"rme":2.87887600088926,"sem":0.000021121903551747494,"deviation":0.0001335866474838445,"mean":0.0014380241090146749,"variance":1.7845392385972937e-8,"numSamples":40},"times":{"cycle":0.07765330188679244,"elapsed":6.437,"period":0.0014380241090146749,"timeStamp":1681769799949}}}},{"name":"fast 32-bit skip, 1 : 8 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 32) { \n if (emptyRows1.bits[rj >>> 5] ^ 0xFFFFFFFF) {\n const rEnd = rj + 32 < rowGroupSize ? rj + 32 : rowGroupSize;\n for(let ri = rj; ri < rEnd; ++ri) {\n if (!emptyRows1.at(ri)) {\n map[row] = ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":28,"cycles":4,"hz":361.27979485984025,"stats":{"moe":0.00001087127783180343,"rme":0.39275730249382723,"sem":0.000005546570322348689,"deviation":0.000035515378865656615,"mean":0.0027679377984256037,"variance":1.2613421359711287e-9,"numSamples":41},"times":{"cycle":0.0775022583559169,"elapsed":6.425,"period":0.0027679377984256037,"timeStamp":1681769806397}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":19,"cycles":4,"hz":228.26855123674912,"stats":{"moe":0.00011097404782690755,"rme":2.5331885122325892,"sem":0.00005234624897495639,"deviation":0.0002158291136286254,"mean":0.004380804953560372,"variance":4.658220628971809e-8,"numSamples":17},"times":{"cycle":0.08323529411764706,"elapsed":8.231,"period":0.004380804953560372,"timeStamp":1681769681798}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":28,"cycles":4,"hz":361.27979485984025,"stats":{"moe":0.00001087127783180343,"rme":0.39275730249382723,"sem":0.000005546570322348689,"deviation":0.000035515378865656615,"mean":0.0027679377984256037,"variance":1.2613421359711287e-9,"numSamples":41},"times":{"cycle":0.0775022583559169,"elapsed":6.425,"period":0.0027679377984256037,"timeStamp":1681769806397}}}},{"name":"fast 32-bit skip, 1 : 32 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 32) {\n if (emptyRows2.bits[rj >>> 5] ^ 0xFFFFFFFF) {\n const rEnd = rj + 32 < rowGroupSize ? rj + 32 : rowGroupSize;\n for(let ri = rj; ri < rEnd; ++ri) {\n if (!emptyRows2.at(ri)) {\n map[row] = ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":53,"cycles":5,"hz":691.5191053122088,"stats":{"moe":0.000009159751621177013,"rme":0.6334143245958382,"sem":0.000004673342663865824,"deviation":0.000030286721999321048,"mean":0.0014460916442048516,"variance":9.172855294641576e-10,"numSamples":42},"times":{"cycle":0.07664285714285714,"elapsed":6.534,"period":0.0014460916442048516,"timeStamp":1681769812829}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":37,"cycles":3,"hz":421.6898306977931,"stats":{"moe":0.00009260824378448752,"rme":3.905195464270049,"sem":0.000043457646074372374,"deviation":0.0001738305842974895,"mean":0.0023714112297781656,"variance":3.0217072037206605e-8,"numSamples":16},"times":{"cycle":0.08774221550179212,"elapsed":8.232,"period":0.0023714112297781656,"timeStamp":1681769690035}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":53,"cycles":5,"hz":691.5191053122088,"stats":{"moe":0.000009159751621177013,"rme":0.6334143245958382,"sem":0.000004673342663865824,"deviation":0.000030286721999321048,"mean":0.0014460916442048516,"variance":9.172855294641576e-10,"numSamples":42},"times":{"cycle":0.07664285714285714,"elapsed":6.534,"period":0.0014460916442048516,"timeStamp":1681769812829}}}},{"name":"fast 32-bit skip, 1 : 256 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 32) { \n if (emptyRows3.bits[rj >>> 5] ^ 0xFFFFFFFF) {\n const rEnd = rj + 32 < rowGroupSize ? rj + 32 : rowGroupSize;\n for(let ri = rj; ri < rEnd; ++ri) {\n if (!emptyRows3.at(ri)) {\n map[row] = ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":265,"cycles":6,"hz":3406.5939133269294,"stats":{"moe":0.000001423360162642495,"rme":0.4848810066529952,"sem":7.262041646135178e-7,"deviation":0.00000464997548776149,"mean":0.00029354834343122083,"variance":2.162227203678271e-11,"numSamples":41},"times":{"cycle":0.07779031100927351,"elapsed":6.736,"period":0.00029354834343122083,"timeStamp":1681769819373}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":170,"cycles":4,"hz":1918.182251756701,"stats":{"moe":0.00002241431983884197,"rme":4.299475050006478,"sem":0.00001057279237681225,"deviation":0.000043592739727322106,"mean":0.0005213268963802499,"variance":1.900326956934047e-9,"numSamples":17},"times":{"cycle":0.08862557238464248,"elapsed":8.572,"period":0.0005213268963802499,"timeStamp":1681769698273}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":265,"cycles":6,"hz":3406.5939133269294,"stats":{"moe":0.000001423360162642495,"rme":0.4848810066529952,"sem":7.262041646135178e-7,"deviation":0.00000464997548776149,"mean":0.00029354834343122083,"variance":2.162227203678271e-11,"numSamples":41},"times":{"cycle":0.07779031100927351,"elapsed":6.736,"period":0.00029354834343122083,"timeStamp":1681769819373}}}},{"name":"fast 8-bit skip, 1 : 8 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 8) { \n if (emptyRows1.bits8[rj >>> 3] ^ 0xFF) {\n const rEnd = rj + 8 < rowGroupSize ? rj + 8 : rowGroupSize;\n for(let ri = rj; ri < rEnd; ++ri) {\n if (!emptyRows1.at(ri)) {\n map[row] = ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":27,"cycles":4,"hz":348.55163727959706,"stats":{"moe":0.00002459090795932406,"rme":0.8571201231414275,"sem":0.00001254638161190003,"deviation":0.0000803360401912389,"mean":0.0028690153568202343,"variance":6.453879353608352e-9,"numSamples":41},"times":{"cycle":0.07746341463414633,"elapsed":6.282,"period":0.0028690153568202343,"timeStamp":1681769826117}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":19,"cycles":3,"hz":236.79086070362192,"stats":{"moe":0.000039603669569798064,"rme":0.9377787004454324,"sem":0.000018584546959079337,"deviation":0.00007433818783631735,"mean":0.004223135964912281,"variance":5.526166170787601e-9,"numSamples":16},"times":{"cycle":0.08023958333333335,"elapsed":7.754,"period":0.004223135964912281,"timeStamp":1681769706850}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":27,"cycles":4,"hz":348.55163727959706,"stats":{"moe":0.00002459090795932406,"rme":0.8571201231414275,"sem":0.00001254638161190003,"deviation":0.0000803360401912389,"mean":0.0028690153568202343,"variance":6.453879353608352e-9,"numSamples":41},"times":{"cycle":0.07746341463414633,"elapsed":6.282,"period":0.0028690153568202343,"timeStamp":1681769826117}}}},{"name":"fast 8-bit skip, 1 : 32 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 8) { \n if (emptyRows2.bits8[rj >>> 3] ^ 0xFF) {\n const rEnd = rj + 8 < rowGroupSize ? rj + 8 : rowGroupSize;\n for(let ri = rj; ri < rEnd; ++ri) {\n if (!emptyRows2.at(ri)) {\n map[row] = ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":76,"cycles":4,"hz":975.3273140022283,"stats":{"moe":0.000006617841335142405,"rme":0.6454561413897362,"sem":0.000003376449660786941,"deviation":0.000021619826659456783,"mean":0.001025296826658661,"variance":4.674169047849583e-10,"numSamples":41},"times":{"cycle":0.07792255882605824,"elapsed":6.663,"period":0.001025296826658661,"timeStamp":1681769832405}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":48,"cycles":4,"hz":606.2407132243684,"stats":{"moe":0.000028147090197085406,"rme":1.7063912036271685,"sem":0.000013276929338247833,"deviation":0.0000547421820454578,"mean":0.0016495098039215688,"variance":2.9967064950980427e-9,"numSamples":17},"times":{"cycle":0.0791764705882353,"elapsed":8.122,"period":0.0016495098039215688,"timeStamp":1681769714610}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":76,"cycles":4,"hz":975.3273140022283,"stats":{"moe":0.000006617841335142405,"rme":0.6454561413897362,"sem":0.000003376449660786941,"deviation":0.000021619826659456783,"mean":0.001025296826658661,"variance":4.674169047849583e-10,"numSamples":41},"times":{"cycle":0.07792255882605824,"elapsed":6.663,"period":0.001025296826658661,"timeStamp":1681769832405}}}},{"name":"fast 8-bit skip, 1 : 256 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 8) { \n if (emptyRows3.bits8[rj >>> 3] ^ 0xFF) {\n const rEnd = rj + 8 < rowGroupSize ? rj + 8 : rowGroupSize;\n for(let ri = rj; ri < rEnd; ++ri) {\n if (!emptyRows3.at(ri)) {\n map[row] = ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":274,"cycles":5,"hz":3574.974541751526,"stats":{"moe":7.984271215130189e-7,"rme":0.28543566328529946,"sem":4.073607762821525e-7,"deviation":0.000002608381659991711,"mean":0.0002797222716752716,"variance":6.803654884181115e-12,"numSamples":41},"times":{"cycle":0.07664390243902443,"elapsed":6.455,"period":0.0002797222716752716,"timeStamp":1681769839077}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":138,"cycles":4,"hz":1686.5381689723192,"stats":{"moe":0.000013776078137511798,"rme":2.3233881597658748,"sem":0.000006498150064864055,"deviation":0.000026792559088548753,"mean":0.0005929305475543096,"variance":7.178412225133763e-10,"numSamples":17},"times":{"cycle":0.08182441556249473,"elapsed":8.322,"period":0.0005929305475543096,"timeStamp":1681769722737}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":274,"cycles":5,"hz":3574.974541751526,"stats":{"moe":7.984271215130189e-7,"rme":0.28543566328529946,"sem":4.073607762821525e-7,"deviation":0.000002608381659991711,"mean":0.0002797222716752716,"variance":6.803654884181115e-12,"numSamples":41},"times":{"cycle":0.07664390243902443,"elapsed":6.455,"period":0.0002797222716752716,"timeStamp":1681769839077}}}},{"name":"fast 32-bit skip, inlined, 1 : 8 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 32) {\n const v = emptyRows1.bits[rj >>> 5]\n if (v !== 0xFFFFFFFF) {\n const rEnd = rj + 32 < rowGroupSize ? 32 : (rowGroupSize - rj);\n for(let ri = 0; ri < rEnd; ++ri) {\n if ((v >> ri) & 1) {\n map[row] = rj + ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":28,"cycles":4,"hz":366.77316293929726,"stats":{"moe":0.000013959340123392205,"rme":0.5119911329601999,"sem":0.000007122112307853166,"deviation":0.00004560376994013341,"mean":0.002726480836236933,"variance":2.079703832752615e-9,"numSamples":41},"times":{"cycle":0.07634146341463412,"elapsed":6.279,"period":0.002726480836236933,"timeStamp":1681769845541}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":26,"cycles":2,"hz":326.8720855810552,"stats":{"moe":0.00005846165416947985,"rme":1.910948282489627,"sem":0.000029827374576265232,"deviation":0.0001713452218351113,"mean":0.0030593006993006986,"variance":2.9359185045723508e-8,"numSamples":33},"times":{"cycle":0.07954181818181816,"elapsed":6.152,"period":0.0030593006993006986,"timeStamp":1681769731070}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":28,"cycles":4,"hz":366.77316293929726,"stats":{"moe":0.000013959340123392205,"rme":0.5119911329601999,"sem":0.000007122112307853166,"deviation":0.00004560376994013341,"mean":0.002726480836236933,"variance":2.079703832752615e-9,"numSamples":41},"times":{"cycle":0.07634146341463412,"elapsed":6.279,"period":0.002726480836236933,"timeStamp":1681769845541}}}},{"name":"fast 32-bit skip, inlined, 1 : 32 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 32) {\n const v = emptyRows2.bits[rj >>> 5]\n if (v !== 0xFFFFFFFF) {\n const rEnd = rj + 32 < rowGroupSize ? 32 : (rowGroupSize - rj);\n for(let ri = 0; ri < rEnd; ++ri) {\n if ((v >> ri) & 1) {\n map[row] = rj + ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":61,"cycles":4,"hz":715.3037863842086,"stats":{"moe":0.00003361990320199791,"rme":2.4048444058259686,"sem":0.000017153011837754037,"deviation":0.00010712052459327799,"mean":0.0013980074187149255,"variance":1.1474806789139075e-8,"numSamples":39},"times":{"cycle":0.08527845254161046,"elapsed":6.436,"period":0.0013980074187149255,"timeStamp":1681769851829}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":54,"cycles":3,"hz":576.4037482476206,"stats":{"moe":0.00005844729588333054,"rme":3.368924042208944,"sem":0.00002862257388997578,"deviation":0.0001593637468770762,"mean":0.0017348950332821298,"variance":2.539680381870082e-8,"numSamples":31},"times":{"cycle":0.09368433179723501,"elapsed":6.817,"period":0.0017348950332821298,"timeStamp":1681769737227}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":61,"cycles":4,"hz":715.3037863842086,"stats":{"moe":0.00003361990320199791,"rme":2.4048444058259686,"sem":0.000017153011837754037,"deviation":0.00010712052459327799,"mean":0.0013980074187149255,"variance":1.1474806789139075e-8,"numSamples":39},"times":{"cycle":0.08527845254161046,"elapsed":6.436,"period":0.0013980074187149255,"timeStamp":1681769851829}}}},{"name":"fast 32-bit skip, inlined, 1 : 256 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 32) {\n const v = emptyRows3.bits[rj >>> 5]\n if (v !== 0xFFFFFFFF) {\n const rEnd = rj + 32 < rowGroupSize ? 32 : (rowGroupSize - rj);\n for(let ri = 0; ri < rEnd; ++ri) {\n if ((v >> ri) & 1) {\n map[row] = rj + ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":291,"cycles":5,"hz":3589.2149746636323,"stats":{"moe":0.00000608672764259993,"rme":2.184657400151874,"sem":0.0000031054732870407808,"deviation":0.00001939367446164937,"mean":0.00027861245622205067,"variance":3.7611460912443105e-10,"numSamples":39},"times":{"cycle":0.08107622476061674,"elapsed":6.447,"period":0.00027861245622205067,"timeStamp":1681769858277}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":251,"cycles":4,"hz":2802.027682322992,"stats":{"moe":0.000015389753795582683,"rme":4.312251615935801,"sem":0.000007525551978280041,"deviation":0.00004121914576181606,"mean":0.00035688441135276735,"variance":1.699017977333839e-9,"numSamples":30},"times":{"cycle":0.0895779872495446,"elapsed":6.488,"period":0.00035688441135276735,"timeStamp":1681769744049}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":291,"cycles":5,"hz":3589.2149746636323,"stats":{"moe":0.00000608672764259993,"rme":2.184657400151874,"sem":0.0000031054732870407808,"deviation":0.00001939367446164937,"mean":0.00027861245622205067,"variance":3.7611460912443105e-10,"numSamples":39},"times":{"cycle":0.08107622476061674,"elapsed":6.447,"period":0.00027861245622205067,"timeStamp":1681769858277}}}},{"name":"fast 8-bit skip, inlined, 1 : 8 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 8) {\n const v = emptyRows1.bits8[rj >>> 3]\n if (v !== 0xFF) {\n const rEnd = rj + 8 < rowGroupSize ? 8 : (rowGroupSize - rj);\n for(let ri = 0; ri < rEnd; ++ri) {\n if ((v >> ri) & 1) {\n map[row] = rj + ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":34,"cycles":5,"hz":411.4798341216631,"stats":{"moe":0.00003614417405212371,"rme":1.4872598743432384,"sem":0.00001844090512863455,"deviation":0.00011516341561697751,"mean":0.0024302527537821647,"variance":1.3262612296568701e-8,"numSamples":39},"times":{"cycle":0.0826285936285936,"elapsed":6.465,"period":0.0024302527537821647,"timeStamp":1681769864733}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":31,"cycles":4,"hz":362.54979522999776,"stats":{"moe":0.00005294854220058727,"rme":1.9196483132549809,"sem":0.000025929746425361057,"deviation":0.00014437071808434443,"mean":0.0027582418005935175,"variance":2.0842904240189254e-8,"numSamples":31},"times":{"cycle":0.08550549581839904,"elapsed":6.333,"period":0.0027582418005935175,"timeStamp":1681769750547}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":34,"cycles":5,"hz":411.4798341216631,"stats":{"moe":0.00003614417405212371,"rme":1.4872598743432384,"sem":0.00001844090512863455,"deviation":0.00011516341561697751,"mean":0.0024302527537821647,"variance":1.3262612296568701e-8,"numSamples":39},"times":{"cycle":0.0826285936285936,"elapsed":6.465,"period":0.0024302527537821647,"timeStamp":1681769864733}}}},{"name":"fast 8-bit skip, inlined, 1 : 32 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 8) {\n const v = emptyRows2.bits8[rj >>> 3]\n if (v !== 0xFF) {\n const rEnd = rj + 8 < rowGroupSize ? 8 : (rowGroupSize - rj);\n for(let ri = 0; ri < rEnd; ++ri) {\n if ((v >> ri) & 1) {\n map[row] = rj + ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":82,"cycles":4,"hz":1062.9629629629621,"stats":{"moe":0.000008209683671970504,"rme":0.8726589680946419,"sem":0.000004188614118352298,"deviation":0.000027145321986731496,"mean":0.0009407665505226487,"variance":7.368685057633284e-10,"numSamples":42},"times":{"cycle":0.0771428571428572,"elapsed":6.517,"period":0.0009407665505226487,"timeStamp":1681769871205}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":76,"cycles":4,"hz":864.3966030357761,"stats":{"moe":0.000035208128251410704,"rme":3.0433786459767354,"sem":0.000017216688631496677,"deviation":0.00009429968729013478,"mean":0.0011568763649556029,"variance":8.892431023017208e-9,"numSamples":30},"times":{"cycle":0.08792260373662582,"elapsed":6.071,"period":0.0011568763649556029,"timeStamp":1681769756890}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":82,"cycles":4,"hz":1062.9629629629621,"stats":{"moe":0.000008209683671970504,"rme":0.8726589680946419,"sem":0.000004188614118352298,"deviation":0.000027145321986731496,"mean":0.0009407665505226487,"variance":7.368685057633284e-10,"numSamples":42},"times":{"cycle":0.0771428571428572,"elapsed":6.517,"period":0.0009407665505226487,"timeStamp":1681769871205}}}},{"name":"fast 8-bit skip, inlined, 1 : 256 ratio","code":"let row = 0;\nfor (let rj = 0; rj < rowGroupSize; rj += 8) {\n const v = emptyRows3.bits8[rj >>> 3]\n if (v !== 0xFF) {\n const rEnd = rj + 8 < rowGroupSize ? 8 : (rowGroupSize - rj);\n for(let ri = 0; ri < rEnd; ++ri) {\n if ((v >> ri) & 1) {\n map[row] = rj + ri;\n row += 1;\n }\n }\n }\n}","results":{"aborted":false,"count":254,"cycles":5,"hz":3316.83092634304,"stats":{"moe":0.0000013603564023817992,"rme":0.45120721862687085,"sem":6.940593889703057e-7,"deviation":0.000004444148495733597,"mean":0.00030149260610716337,"variance":1.9750455852131198e-11,"numSamples":41},"times":{"cycle":0.07657912195121949,"elapsed":6.469,"period":0.00030149260610716337,"timeStamp":1681769877733}},"platforms":{"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0":{"aborted":false,"count":189,"cycles":3,"hz":2262.775781861951,"stats":{"moe":0.000006011376226663025,"rme":1.360239654135377,"sem":0.0000029438669082580928,"deviation":0.000016390757260714005,"mean":0.000441935081688535,"variance":2.686569235796489e-10,"numSamples":31},"times":{"cycle":0.08352573043913313,"elapsed":6.457,"period":0.000441935081688535,"timeStamp":1681769762967}},"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36":{"aborted":false,"count":254,"cycles":5,"hz":3316.83092634304,"stats":{"moe":0.0000013603564023817992,"rme":0.45120721862687085,"sem":6.940593889703057e-7,"deviation":0.000004444148495733597,"mean":0.00030149260610716337,"variance":1.9750455852131198e-11,"numSamples":41},"times":{"cycle":0.07657912195121949,"elapsed":6.469,"period":0.00030149260610716337,"timeStamp":1681769877733}}}}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment