Test name | Executions per second |
---|---|
fetch | 2500.5 Ops/sec |
import | 55093.5 Ops/sec |
<!--your preparation HTML code goes here-->
let obj = {a:Array.from({length:1337},(b,i)=>i)}
let src = URL.createObjectURL(new Blob([JSON.stringify(obj)]))
obj = null
void async function () {
(await (await fetch(src)).json()).a.reduce((a,b)=>a+b)
URL.revokeObjectURL(src)
deferred.resolve()
}()
void async function () {
(await import(src, { with: { type: 'json' } })).a.reduce((a,b)=>a+b)
URL.revokeObjectURL(src)
deferred.resolve()
}()