-
-
Notifications
You must be signed in to change notification settings - Fork 1k
JSX DOM render extremely slow #3201
Copy link
Copy link
Closed
Labels
Description
What version of Hono are you using?
4.5.2
What runtime/platform is your app running on?
Bun
What steps can reproduce the bug?
import { render } from "hono/jsx/dom";
const root = document.getElementById("root");
render(
<>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
</>
, root);What is the expected behavior?
Rendering something of that complexity should be immediate
What do you see instead?
It takes about 12 seconds to render the code above. Twice as much if I add one more <div><span></span></div>
Additional information
The time it takes for the render function to complete increases exponentially with the amount of nodes.
From what I gathered it seems to get stuck in the findInsertBefore function
Reactions are currently unavailable