Skip to content

Commit 799588d

Browse files
committed
feat(benchmark): test perf of nested await arrow functions
Parsing 'await a => await b => ...' is slow. Write a benchmark to demonstrate the slowness.
1 parent 8a94d63 commit 799588d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

benchmark/benchmark-parse.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,27 @@ await/
8888
()=>{{{{{{{await/
8989
()=>{{{{{{{await/
9090
)"_sv);
91+
BENCHMARK_CAPTURE(benchmark_parse, pathological_await_arrow,
92+
u8R"(
93+
await a =>
94+
await a =>
95+
await a =>
96+
await a =>
97+
await a =>
98+
await a =>
99+
await a =>
100+
await a =>
101+
await a =>
102+
await a =>
103+
await a =>
104+
await a =>
105+
await a =>
106+
await a =>
107+
await a =>
108+
await a =>
109+
await a =>
110+
a
111+
)"_sv);
91112
} // namespace
92113
} // namespace quick_lint_js
93114

0 commit comments

Comments
 (0)