Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformer performing extremely badly on cal.com benchmark #5457

Closed
overlookmotel opened this issue Sep 4, 2024 · 4 comments
Closed

Transformer performing extremely badly on cal.com benchmark #5457

overlookmotel opened this issue Sep 4, 2024 · 4 comments
Assignees
Labels
A-transformer Area - Transformer / Transpiler C-bug Category - Bug

Comments

@overlookmotel
Copy link
Contributor

#5324 enabled all > es6 transforms in our transformer benchmarks.

As expected, measured performance dropped a lot, because the transformer doing much more work in our benchmarks.

However, something is badly wrong with the transformer on the cal.com benchmark. It went from 12.2 ms to over 6 seconds!

bench

I doubt this is a problem with the benchmarks. Likely one of the transforms is behaving extremely badly in some circumstances, and the cal.com fixture is triggering that behavior.

But which transform is the culprit?

@Boshen
Copy link
Member

Boshen commented Sep 5, 2024

It's this:

                    // Enable React related plugins
                    transform_options.react.development = true;

What's so special about development?

@Boshen
Copy link
Member

Boshen commented Sep 5, 2024

// TODO: We shouldn't calculate line + column from scratch each time as it's expensive.
// Build a table of byte indexes of each line's start on first usage, and save it.
// Then calculate line and column from that.
let (line, column) = get_line_column(elem.span.start, self.ctx.source_text);

@Boshen
Copy link
Member

Boshen commented Sep 5, 2024

image

@Boshen
Copy link
Member

Boshen commented Sep 5, 2024

Continue in #5500

@Boshen Boshen closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transformer Area - Transformer / Transpiler C-bug Category - Bug
Projects
None yet
Development

No branches or pull requests

2 participants