udecode / plate

The rich-text editor for React.
https://platejs.org
Other
9.42k stars 614 forks source link

Regression: `serializeHtml` now 10x slower #3210

Open shaungrady opened 2 months ago

shaungrady commented 2 months ago

Description

Migrating from 30.5.3 to 33.0.0, I'm noticing a huge decrease in the performance of the serializeHtml call. It looks like it occurred with the change in this PR: https://github.com/udecode/plate/pull/3149

I've attached below profiles for the serializeHtml call in the old and new versions with a document consisting of 107 root child nodes.

v30.5.3 (108ms)

image

v33.0.0 (1.2s)

image

Steps to Reproduce

Create a decently sized document of 100+ nodes, execute the serialize call.

Expected Behavior

Environment

Bounty

Click here to add a bounty via Algora.

Funding

Fund with Polar

zbeyens commented 2 months ago

Thanks for the report. Let’s revert this for now and explore a better solution. Please open a PR at your earliest convenience.

shaungrady commented 2 months ago

Sounds good, @zbeyens! I'm not sure how soon I can get to this, so please don't wait on me if you need this addressed urgently.

dimaanj commented 1 month ago

@shaungrady Which version of react you are using btw?

shaungrady commented 1 month ago

@dimaanj Good question: 18.2.0