Created
August 29, 2021 02:17
-
-
Save felipeplets/011a566c4a6b984869b00cb9f876eb22 to your computer and use it in GitHub Desktop.
Double-await effect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"title":"Double-await effect","initialization":"async function sleep() {\n return new Promise(resolve => setTimeout(resolve, 1))\n}","setup":"// runs before each test","tests":[{"name":"Double-await","code":"async function test() {\n return await sleep()\n}\n(async () => await test())() ","results":{"aborted":false,"count":15251,"cycles":3,"hz":108334.57519549297,"stats":{"moe":9.613797293851013e-7,"rme":10.415066458449294,"sem":4.904998619311742e-7,"deviation":0.0000030631706559748736,"mean":0.000009230663416508259,"variance":9.383014467625536e-12,"numSamples":39},"times":{"cycle":0.14077684776516744,"elapsed":10.969,"period":0.000009230663416508259,"timeStamp":1630203291246}},"platforms":{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Edg/92.0.902.78":{"aborted":false,"count":24400,"cycles":3,"hz":190763.63636363644,"stats":{"moe":1.1983958554675582e-7,"rme":2.2861035119210227,"sem":6.114264568712032e-8,"deviation":4.0093914030647033e-7,"mean":0.000005242089210827295,"variance":1.607521942296915e-13,"numSamples":43},"times":{"cycle":0.127906976744186,"elapsed":16.669,"period":0.000005242089210827295,"timeStamp":1630202940477}},"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36":{"aborted":false,"count":24400,"cycles":3,"hz":180774.2174476755,"stats":{"moe":4.563059480646393e-7,"rme":8.248835067810484,"sem":2.3280915717583638e-7,"deviation":0.0000014724143936395527,"mean":0.000005531762295081967,"variance":2.1680041465969317e-12,"numSamples":40},"times":{"cycle":0.13497499999999998,"elapsed":12.682,"period":0.000005531762295081967,"timeStamp":1630203081067}},"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15":{"aborted":false,"count":30500,"cycles":3,"hz":197831.7272053373,"stats":{"moe":2.1539308119524825e-7,"rme":4.261158528093541,"sem":1.098944291812491e-7,"deviation":6.501442107544603e-7,"mean":0.00000505480093676815,"variance":4.226874947775401e-13,"numSamples":35},"times":{"cycle":0.15417142857142857,"elapsed":13.067,"period":0.00000505480093676815,"timeStamp":1630203158273}},"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0":{"aborted":false,"count":15251,"cycles":3,"hz":108334.57519549297,"stats":{"moe":9.613797293851013e-7,"rme":10.415066458449294,"sem":4.904998619311742e-7,"deviation":0.0000030631706559748736,"mean":0.000009230663416508259,"variance":9.383014467625536e-12,"numSamples":39},"times":{"cycle":0.14077684776516744,"elapsed":10.969,"period":0.000009230663416508259,"timeStamp":1630203291246}}}},{"name":"Single-await","code":"async function test() {\n return sleep()\n}\n(async () => await test())() ","results":{"aborted":false,"count":12704,"cycles":3,"hz":110985.56575611564,"stats":{"moe":0.0000015555974702920728,"rme":17.2648865329148,"sem":7.936721787204452e-7,"deviation":0.00000526462564671922,"mean":0.000009010180676984989,"variance":2.7716283200093768e-11,"numSamples":44},"times":{"cycle":0.11446533532041729,"elapsed":11.686,"period":0.000009010180676984989,"timeStamp":1630203302405}},"platforms":{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Edg/92.0.902.78":{"aborted":false,"count":24400,"cycles":3,"hz":236495.80615097855,"stats":{"moe":1.1796585695472705e-7,"rme":2.7898430438799195,"sem":6.018666171159543e-8,"deviation":4.3401218980032507e-7,"mean":0.0000042284047919293825,"variance":1.8836658089527341e-13,"numSamples":52},"times":{"cycle":0.10317307692307694,"elapsed":15.692,"period":0.0000042284047919293825,"timeStamp":1630202957332}},"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36":{"aborted":false,"count":24400,"cycles":3,"hz":237558.50964238908,"stats":{"moe":3.016529535175841e-7,"rme":7.166022606686215,"sem":1.539045681212164e-7,"deviation":0.0000011098216237783724,"mean":0.000004209489281210592,"variance":1.2317040366060633e-12,"numSamples":52},"times":{"cycle":0.10271153846153845,"elapsed":18.422,"period":0.000004209489281210592,"timeStamp":1630203093927}},"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15":{"aborted":false,"count":28594,"cycles":3,"hz":237732.21085203942,"stats":{"moe":1.5595501828653138e-7,"rme":3.707553129072734,"sem":7.956888688088336e-8,"deviation":5.512694191175626e-7,"mean":0.000004206413579447101,"variance":3.038979724542149e-13,"numSamples":48},"times":{"cycle":0.1202781898907104,"elapsed":14.25,"period":0.000004206413579447101,"timeStamp":1630203171563}},"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0":{"aborted":false,"count":12704,"cycles":3,"hz":110985.56575611564,"stats":{"moe":0.0000015555974702920728,"rme":17.2648865329148,"sem":7.936721787204452e-7,"deviation":0.00000526462564671922,"mean":0.000009010180676984989,"variance":2.7716283200093768e-11,"numSamples":44},"times":{"cycle":0.11446533532041729,"elapsed":11.686,"period":0.000009010180676984989,"timeStamp":1630203302405}}}}]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment