rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Performance drop w/ huge JSX statements

Open ryyppy opened this issue 6 years ago • 1 comments

We had a case in the ReasonConf US 2019 website where we wanted to codify some SVG in a React component. It's a very complex SVG with a lot of paths, therefore the file is reaching around 6000 LOC of nested JSX components with <path/> elements.

Concrete standalone component: https://gist.github.com/ryyppy/0224e28320c8cef7d8465a0d8abc4eac

On my 13 inch Macbook 2016:

>>>> Start compiling
[2/2] Building components/HeroGraphic.mlast.d
[1/1] Building components/HeroGraphic.cmj
>>>> Finish compiling 30944 mseconds

Apparently it speeds up when not using refmt, since it sidesteps a lot of extra computation, but type-checking still seems to be pretty slow.

Would be interesting at which point it is getting really slow. Will keep this issue around for awareness.

ryyppy avatar Jul 18 '19 14:07 ryyppy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 07 '21 14:07 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 07 '23 05:08 stale[bot]