NME windows target slow to compile

88 views
Skip to first unread message

Jake Lewis

unread,
Jan 28, 2015, 12:10:46 AM1/28/15
to haxe...@googlegroups.com
This is my first project with NME and I'm loving that code runs in Flash and Windows.

However, I'm experiencing very long compile time (3 hours!) on my NME windows release build. Debug build is just a minute or so.  The culprit classes simply contain big arrays of floating point data.

I notice that the -O2 (optimize for fast code) flag is set for  release builds - is there a way to change this per source file? (these big array classes are loaded upon initilization at runtime so I'm not too concerned with speed of execution). 

 Failing that, where would I go about changing the compiler command line globally so I can at least speed up compilation as I'm testing?

Regards, Jake.

Carlos Madrazo

unread,
Jan 28, 2015, 8:29:04 AM1/28/15
to haxe...@googlegroups.com
These are easy to change in the hxcpp toolchain directory. I always feel that an intermediate compilation flags between debug and release would be used. It could be named "development", so release would be used for final release.

Nicolas Cannasse

unread,
Jan 28, 2015, 4:25:57 PM1/28/15
to haxe...@googlegroups.com
Le 28/01/2015 06:10, Jake Lewis a écrit :
> This is my first project with NME and I'm loving that code runs in Flash
> and Windows.
>
> However, I'm experiencing very long compile time (3 hours!) on my NME
> windows release build. Debug build is just a minute or so. The culprit
> classes simply contain big arrays of floating point data.

Why not storing these data in files and reading them from disk at runtime ?

Best,
Nicolas

Hugh

unread,
Jan 28, 2015, 11:56:35 PM1/28/15
to haxe...@googlegroups.com
Yes, datafile/resource is probably the best way to go, but you could try a class-specific pragma, like:

@:cppFileCode("#pragma optimize( \"ts\", off )")
class MySlowClass.....

Hugh

Nicolas Cannasse

unread,
Jan 29, 2015, 3:56:49 AM1/29/15
to haxe...@googlegroups.com
Le 29/01/2015 05:56, Hugh a écrit :
> Yes, datafile/resource is probably the best way to go, but you could try
> a class-specific pragma, like:
>
> @:cppFileCode("#pragma optimize( \"ts\", off )")
> class MySlowClass.....

Do we have that by default for the place where haxe.Resources are included ?

Best,
Nicolas

Hugh

unread,
Jan 29, 2015, 11:32:22 PM1/29/15
to haxe...@googlegroups.com
The resource data are not really generated using "code" - just static data declarations, so I don' t think the optimizer will get too bogged down.  Inline array declarations use code because you can mix in different expressions.  However, there would be room to test for constant declarations and move the code to some kind of data and probably save soome compile time as well as runtime.
If there is a difference in compile times for resources with and without debug, compile flags would be something to look at.

Hugh
Reply all
Reply to author
Forward
0 new messages