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

Perf Improvements 3 #241

Merged
merged 17 commits into from
Nov 14, 2022
Merged

Perf Improvements 3 #241

merged 17 commits into from
Nov 14, 2022

Conversation

developit
Copy link
Member

@developit developit commented Aug 22, 2022

This improves performance by another 5-10% compared to master (5.2.2):
Screen Shot 2022-08-21 at 6 36 54 PM

It also corrects the type definitions, reduces size by ~50% and removes pretty-printing entirely from the default bundle. It can still be accessed via preact-render-to-string/jsx.

Because of the exports/options change, I'm marking this as a major release.

@changeset-bot
Copy link

changeset-bot bot commented Aug 22, 2022

🦋 Changeset detected

Latest commit: f0f62c8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-render-to-string Major

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Member

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

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

Let's merge this after we do one more release with the _diff and diffed cahnges

@developit
Copy link
Member Author

@JoviDeCroock good call, definitely worth getting those landed on 5.x.

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

I really like the move to split off the pretty option from the default render function. This is great 👍

@marvinhagemeister marvinhagemeister merged commit fac1544 into master Nov 14, 2022
@marvinhagemeister marvinhagemeister deleted the perf-improvements-3 branch November 14, 2022 08:29
@github-actions github-actions bot mentioned this pull request Nov 14, 2022
developit added a commit that referenced this pull request Feb 2, 2023
… on #241 (#267)

* use index.module.js when benchmarking, since its the output of `npm run transpile`

* fix bench:v8 output path

* update microbundle and turn off function inlining

* fix JSX entrypoint and tests

* fix type defintion to reflect removed exports and options

* fix root copy of jsx types

* optimize renderToString performance using switch and short-circuiting

* Create bright-ligers-jam.md

* Update bright-ligers-jam.md

* Update bright-ligers-jam.md

* Backport changes from #237 (child/parent properties, simplified Fragment handling)

* ci: update github actions (#266)

* ci: update actions/checkout to v3

* ci: update actions/cache to v3

* merge master

* lockfile version

* update benchmarking reference implmementation to 5.2.6 (6a0bec2)

* fix tests

* fix before diff hook being called on invalid vnodes

* move non-exported files into a lib directory

* update pretty implementation and move typedefs into a d.ts

* Move chunked implementation out of the default entrypoint

* update tests to reflect chunking being moved out of default entrypoint

* fix d8 bench script

---------

Co-authored-by: Abdul Rauf <[email protected]>
JoviDeCroock added a commit that referenced this pull request May 6, 2024
…296)

* Disable eslint lines-around-comment rule

* Update test scripts to allow watch usage

* Add streaming renderer

* Switch to element nodes as markers instead

* Switch away from global ids

* Remove subtree option

* feat: use comments instead of element as marker
feat: use custom element for hydration
feat: add onError to renderToChunks
feat: add renderToPipeableStream

* chore: use NodeIterator to locate comments

This reduces code and *should* also be more performant than recursive JS iteration.

See: https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator

* chore: remove redundancy and minify code

* more minification

* even more minification

* Move files to new test dir structure

* Fix linting error

* fix ts types

* fix Web Streams tests on Node <18

* Streaming renderer: factor chunking out of main entrypoint and rebase on #241 (#267)

* use index.module.js when benchmarking, since its the output of `npm run transpile`

* fix bench:v8 output path

* update microbundle and turn off function inlining

* fix JSX entrypoint and tests

* fix type defintion to reflect removed exports and options

* fix root copy of jsx types

* optimize renderToString performance using switch and short-circuiting

* Create bright-ligers-jam.md

* Update bright-ligers-jam.md

* Update bright-ligers-jam.md

* Backport changes from #237 (child/parent properties, simplified Fragment handling)

* ci: update github actions (#266)

* ci: update actions/checkout to v3

* ci: update actions/cache to v3

* merge master

* lockfile version

* update benchmarking reference implmementation to 5.2.6 (6a0bec2)

* fix tests

* fix before diff hook being called on invalid vnodes

* move non-exported files into a lib directory

* update pretty implementation and move typedefs into a d.ts

* Move chunked implementation out of the default entrypoint

* update tests to reflect chunking being moved out of default entrypoint

* fix d8 bench script

---------

Co-authored-by: Abdul Rauf <[email protected]>

* fix d8 bench path

* try new way of getting mask as we are not setting it anymore

* stop interfering with the real useId

* show bug

* partial fix

* continuously fork promises

* fix tests

* fixes

* update lockfiles

* Create twelve-candles-walk.md

* add build command

* fix rebase issues

* address comments

* bump deps

---------

Co-authored-by: Marvin Hagemeister <[email protected]>
Co-authored-by: Jacob Ebey <[email protected]>
Co-authored-by: Jason Miller <[email protected]>
Co-authored-by: Jason Miller <[email protected]>
Co-authored-by: Abdul Rauf <[email protected]>
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.

3 participants