Skip to content

pref: batch processing js snippets in template #5

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

Merged
merged 2 commits into from
Apr 4, 2025

Conversation

Teages
Copy link
Collaborator

@Teages Teages commented Apr 4, 2025

When dealing with #3, I try to write some code to get a benchmark of esbuild.

With about a thousand samples (like hello()), esbuild took more than 500ms to process, even slower than babel. But if I merge them into one file, it cost only 60ms, about 10x faster.

This PR simulate Vue's behavior, use the snippets as the argument of a function, it should avoid a lot of edge cases.

This also make it less "magick"😂

@Teages Teages requested a review from Copilot April 4, 2025 23:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Teages Teages merged commit e072e53 into main Apr 4, 2025
2 checks passed
@Teages Teages deleted the pref/template-batch-js-snippets branch April 4, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant