3

I'm currently using Haxe, specifically haxeflixel for development. One thing that really bugs me is the build/compile time. I'm not even compiling to c++ target but decided to compile to neko vm as I thought it maybe faster. However; the compile time to neko debug (or release) is about 4 or 5 seconds. Having to wait this long every time I want to see a result makes it dreadfull :).

I even tried to debug with -v command and the parts that take the most time are:

Running command: BUILD
 - Copying library file:     

C:\HaxeToolkit\haxe\lib\lime/2,9,1/legacy/ndll/Windows/lime-legacy.ndll ->   export/windows/neko/
bin/lime-legacy.ndll

- Running command: haxe export/windows/neko/haxe/release.hxml

From the above excerpt it seems like everything is behaving normally, which worries me because I do not want normal to be this slow.

Now 4 or 5 seconds might not seem a lot to some people but with the Golang, javascript , java and other super faster compiled languages out there - i'm spoiled. Is there another target I can compile to that I dont know about which would be faster than neko vm compilation? Is there anything I can do to increase compile speed or further debug the cause of the compile slowness?

efel
  • 1,054
  • 3
  • 14
  • 29

2 Answers2

5

You can consider using the compilation server:

  1. From a terminal, run haxe --wait 6000
  2. In your hxml, add --connect 6000

This will make your build use the compilation server, which caches unchanged modules and compiles only changed modules. This will speed up your build.

KevinResoL
  • 982
  • 8
  • 19
  • This builds the first time fine, however; building a second time produces errors: > lime test neko --connect 6000 C:\HaxeToolkit\haxe\std/haxe/macro/Compiler.hx:250: lines 250-264 : Invalid field access : __a :1: character 0 : Called from Aborted – efel Jan 31 '17 at 11:54
  • This may be due to some bugs in the compiler, what version of haxe are you using? Also you should try using latest haxe (3.4) which has been released just now. – KevinResoL Feb 01 '17 at 06:01
  • I'm using haxe 3.4.0 and lime 2.9.1 – efel Feb 01 '17 at 11:35
  • Well, I have not much idea on lime, as I don't use it. Maybe you can report it to the haxe or lime repo. – KevinResoL Feb 02 '17 at 03:50
  • I'm going to accept this as the correct answer even though it does not work at this time. I submitted a bug report and appears this is a haxe issue. However; judging by documentation this should work. – efel Feb 03 '17 at 02:01
1

Had a similar concern with running a large number of unit tests very quickly. Ended up building to JS and running the tests in node.

Pair that with gulp to build the code and process resources things can end up running pretty quick.