Compilation performance on windows

Environment: win10 x64 16GB RAM 8core CPU
I am using rescript in a font-end project, it’s dependiences is below:
Build command:
yarn rescript build -w
Every time i edit a file and save it whether it is referenced by other file or not, the compile process take a long time to compile done.

Is anyone else has this problem?


In my case, the file VideoToGif__PictureCache.res is not referenced by other module, but it takes 10 seconds to compile done.

Here is the screen recording:


The related issue:

I did have a case once where compilation was slow; I think it was between 10 and 20 seconds.

I discovered it was due to having a very large number of files in my project. Specifically I had one directory that contained a few thousand image files.

This was on a Mac though, not Windows.

Hmm, my rescript source directory only contains 216 files(.res files and .js files which is generated by rescript).

It looks like no body use rescript on windows except me.:sweat_smile::sweat_smile::sweat_smile:

Sorry, I only do gaming on windows or .net related stuff like unity development, or creative stuff (adobe) :sweat_smile:

I have used rescript on windows. I have always relied on the integrated terminal for running rescript compiler. The performance was decent when I try to use git bash it was bad I did not dig deep and then I switched to Mac. Not sure if that helps you.

Seems you are using integrated terminal as well.

@sriky27 I don’t understand your means very well. Did you means that the performance is decent if i use the intergrated terminal and remove the .git directory? Acturally i haved tryed the vscode integrated terminal,the windows cmd, powershell, removing .git directory, the compiling performance is not good(atleast 8s for compiling an edited file whether or not the file is referenced by other file), which is much poor then tsc. I don’t know if it is same on mac or linux.

I meant I did not face such poor performance, when I was editing files on windows. My colleagues are facing slow compilation on windows. On Mac the compilation is very fast, better than tsc for sure.

In our project we have about 100 files plus dependencies. Our CI is linux based it also compiles fast as well. Our dependencies are only the following.

"bs-dependencies": [

It’s werid.Hmm, how long it takes to finish compiling for a single edited file on Mac or on Linux? May be i should change to a Mac computer before this problem be fixed.

1 Like

This is an example.

Start compiling
Finish compiling 98 mseconds

I have
MacBook Pro (16-inch, 2019)
2,3 GHz 8-Core Intel Core i9
32 GB 2667 MHz DDR4

@Hongbo Hi,why is there such a big difference of the performance on mac and Windows?
This picture looks like the compiler compiles other files while i edited a irrelevant file Playground.res which is just used for some irrelevant test. It takes 7 seconds to finish compilation for this edited file.

I have recreated a new empty nextjs based project and integrated rescript into it. The increment compilation and extension’s auto-complete works very fast on my computer. The rescript dependencies of this project are the same with my previous project, i don’t known why there is such a big performance difference, but i will keep updating if i find the point.

After copying the res directory from my previous project to this empty project, the compilation becomes slow again. It takes 7 seconds to finish compiling after i edited the irrelevant file Playground.res.

Do you have a sample repo with a lot of files that I can try out on my local?

I’m on a windows 11 surface studio and my code compiles way faster than my ts projects do, but I’ve never reached > 100 files so I’d like to give it a try

@hellos3b I have made a sample project which contains 150 rescript files, and i simulated some simple module dependencies, but it seems like that the incremental compilation is not much relevant with files num.

I found some advises on the latest documation.

After some attempts, i make the incremental compilation time down to almost 1s from 10-20s by just shutting down the unused variable warnings check. I don’t know if it is a issue only on windows that the unused variable warning check will slow down the incremental compilation, it did influnces on my win10 computer.

To be honest, this makes me feel much better.

The user experience and development efficiency get much much much better.:sweat_smile:

Keep in mind you can also omit the warnings file-wise with the @@warning decorator. E.g.