Skip to content

[labs/ssr] Add performance benchmarking#5103

Open
jimsimon wants to merge 5 commits intolit:mainfrom
jimsimon:ssr-benchmarks
Open

[labs/ssr] Add performance benchmarking#5103
jimsimon wants to merge 5 commits intolit:mainfrom
jimsimon:ssr-benchmarks

Conversation

@jimsimon
Copy link
Collaborator

@jimsimon jimsimon commented Sep 22, 2025

This PR adds a suite of performance benchmarks to Lit SSR help developers analyze the perf impact of their changes. Currently these need to be run manually on the developer's local machine before and after their changes.

The benchmarks try to simulate multiple different sizes and complexities of Lit templates representing something vaguely similar to Reddit's comments tree. This is easily Reddit's most complex and performance sensitive rendering scenario due to the heavy amounts of recursive nesting.

I wasn't able to use Tachometer like the existing benchmarks do, because we want these to run in Node and not in the browser. I originally wanted to use k6, but it doesn't support loading packages from node_modules. I ended up having AI implement a sort of custom test runner that simulates what k6 is trying to do.

One thing that's still missing is the ability to have a scenario run multiple times concurrently. This is somewhat outside of the scope of what I currently need, so it's left as future work.

I'm happy to move this onto a proper benchmarking platform (e.g. Artillery, Gatling, etc) if there's a strong preference.

Sample output:
image

@changeset-bot
Copy link

changeset-bot bot commented Sep 22, 2025

⚠️ No Changeset found

Latest commit: d55737f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@justinfagnani
Copy link
Collaborator

It would be nice if Tachometer could run Node benchmarks: google/tachometer#274

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.

2 participants