Test name | Executions per second |
---|---|
async await | 1752023.9 Ops/sec |
old way | 1178758.4 Ops/sec |
const c = async () => {
let temp = 3
throw temp
}
const b = async () => {
let temp = 2
return temp
}
const a = async () => {
let temp = 1
temp = await b().catch(e => { throw e })
temp = await c().catch(e => { throw e })
return temp
}
a().catch(e => {})
const c = () => {
let temp = 3
throw temp
}
const b = () => {
let temp = 2
return temp
}
const a = () => {
let temp = 1
try {
temp = b()
} catch (e) {
throw e
}
try {
temp = c()
} catch (e) {
throw e
}
return temp
}
try {
a()
} catch (e) {
}