#1298 Compile skipping type safety checks?

rfeldman Mon 8 Nov 2010

Years ago, I was working on a complicated web app in Perl. The server was running mod_perl, which would compile the Perl modules together in a trivial amount of time; performance was great, and implementing small updates was lightning-fast.

Subsequently I went to work in a Java shop. One of the first things I noticed was how long it took to make small changes, because if the change was high enough in the dependency tree, you had to rebuild everything. It could take half a minute to tweak one line of code.

I used various tricks to combat this, of course - skipping unit tests when I knew they wouldn't be affected, etc. - but build times remained a significant drag on my productivity.

Given that Fantom has its own compiler, I wonder if it would be possible to pass an argument to the compiler that would have it skip type safety checking, in order to cut down on build times when you know the change you've made will have no impact on type safety. (e.g. your only modifications were to dynamic code in the middle of a method anyway.)

Would that even be possible? Would it ultimately produce equivalent bytecode? Would it significantly cut down on compile times?

I have no idea, but I thought I'd put the idea out there because Fantom is so driven by practicality. Long compile times have always seemed to be one of the greatest downsides to Java-based languages compared to PHP and the like, and being able to cut down on that would be absolutely fantastic.

brian Mon 8 Nov 2010

I don't think it would really help. You can add some testing to Compiler.fan, but for example compiling testSys:

total:           3100ms
Parsing:         ~500ms (16%)
CheckErrors:     ~150ms (4%)
JavaScript gen: ~1000ms (32%)
Backend:        ~1271ms (41%)

I haven't dug deeply into compiler speed, but parsing/backend I/O seems to drive a huge chunk of total compile time.

rfeldman Mon 8 Nov 2010

Huh, interesting.

Maybe the real solution is to replace my magnetic HD with a SSD... :D

Login or Signup to reply.