Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Real-world ReScript vs TypeScript build performance: Complete dinero.js core rewrite

$
0
0

I was a bit puzzled by the incremental build time in TypeScript being the same as the clean build. That didn’t make sense to me, so I did check out the repository locally and I verified that the incremental flag is not set anywhere, neither in the command line or in the tsconfig file.

After setting incremental to true in the tsconfig file, then the results do change. This is what I get in my laptop.

============================================================
BENCHMARK SUMMARY
============================================================
Clean Builds:
   ReScript:  0.362s avg (5 trials, 68 modules)
   TypeScript: 0.225s avg (5 trials)
Incremental Builds:
   ReScript:  0.255s avg (5 trials, 3 modules)
   TypeScript: 0.191s avg (5 trials)
Incremental Savings vs Clean Builds:
   ReScript:  0.107s (1.4x faster)
   TypeScript: 0.034s (1.2x faster)
Clean Build Winner: TypeScript (0.137s faster, 1.6x faster)
Incremental Build Winner: TypeScript (0.064s faster, 1.3x faster)
============================================================

Generally speaking, now the TypeScript numbers make a little bit more sense given that the incremental is a bit shorter given we are touching only one file.

Regarding compile time comparisons between the two compilers, this is highly dependent on the code and there is one thing that Rescript will always win on, which is that the type system is simpler and will have more predictable compile times as code size grows.

TypeScript’s type system is so complicated and powerful that you are bound to include libraries that will skyrocket your compile times as the project grows. This is of course a lot harder to prove with benchmarks, especially when doing the project in both rescript and typescript, because they cannot express the same things with the same type safety. They are very different when you go to the advanced parts of them.

My interpretation, these are great results because they are in the same order of magnitude as the new TypeScript compiler which has been engineered from scratch with performance in mind and with lots of lessons learned from all the previous compiler versions.


Viewing all articles
Browse latest Browse all 2592

Trending Articles