-
Couldn't load subscription status.
- Fork 1k
Closed
Description
const a = {}
for (let i = 0; i < 10000000; i++) {
a[i] = i
}
const start = new Date().getTime()
a[1]
console.log("cost:", (new Date().getTime() - start), "ms")The cost time between QuickJS and V8 (Node) when running the above code.
quickjs: 83 ms
v8: 1 ms
Object property queries under QuickJS still take a relatively long time, I would like to understand the reason for this performance gap, and whether there are any optimization strategies. Additionally, when I changed the object to an array, I was able to save about half of the time
Metadata
Metadata
Assignees
Labels
No labels