yarn
yarn build --watch
yarn serve
(in a separate terminal window)- Visit
localhost:3000/
to load the application and compare the two different implementations! - You can open the Javascript console on any of the pages to see the performance. To see how they stack up side-by-side, you can open two separate windows in your browser.
- The
/mobx-optimal
window will fill up with gray squares faster than the/naive
window - The gap between naive React
useState
and MobX shrinks when compiling withNODE_ENV=production
. The React version is unbearably slow when using the development bundle. MobX works fine though! - The speed increases from the new
createRoot
fromreact-dom/client
is considerable compared torender
fromreact-dom
. This is part of React 18's batching.