200K Lines
200,000 mounted <p> elementsThis test is meant to stress-test how well both frameworks handle extremely large payloads; as well as how efficiently they scale up.
By creating a page with 200 thousand individual <p>Stress-Testing.</p> elements, we effectively scale up every miniscule bit of baggage both frameworks accumulate, exposing inefficiencies.
At first you may think that something is incorrect with the test data, and so did we. However, the byte size is actually correct. The page HTML is roughly 4.2Mb in size, but the out-of-the-box Brotli compression in elegance comresses it down to a couple hundred bytes transferred. Elegance also does not ship a VDOM, nor any other unneeded JavaScript. This page also contains no interactive elements, meaning our JS shipped was a mere few kilobytes.
For Next.JS, we were shocked to see that the actual page HTML generated by default was a stagerring 18.1 megabytes! We suspect this is because Next.JS by default includes a serialized VDOM of sorts, GZIP tries it's best, and to it's credit it actually shrinks the page HTML down to about a megabyte.
Developer Notes: On this machine, the page does build with Next.JS 16 - but Next's cache rejected the rendered page ("Single item size exceeds maxSize"), so every request re-renders the full 19 MB HTML, gzip compressing it on the fly.
We are also aware this is not hyper-realistic in terms of usage, but it's interesting to note, nevertheless.
// Elegance (pages/page.tsx) and Next.JS (app/page.tsx)
export default function page() {
return <div>
<h1>Stress-Testing.</h1>
{/* ... 200 thousand more times ... */}
</div>
}