Macro Benchmarking

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Macro Benchmarking

Nicolas Cannasse
Hi,

I added in r3861 a new -D macrotimes flag that can be used together with
--times to get precise timing of macro calls done while compiling. This
can help you understanding how time is spent in compilation, and
optimize accordingly.

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Macro Benchmarking

Dion Whitehead Amago
According to the compiler output, my macros are fast, but the
"generate swf" and "typing" are taking the longest.  On one hand,
that's cool, because my macros are generating quite a few classes.  On
the other hand, my compilation is still rather slow.

I'm guessing no, but is there anything I could do to speed "generate
swf" and "typing" up?  I have a fairly complex project and with 3
-swf-lib embeds.

Dion


Total time : 6.993s
------------------------------------
  generate swf : 1.983s, 28%
  macro com.pblabs.util.PBMacros.buildEnumerableEnumFromEmbeddedXML : 0.002s, 0%
  macro com.pblabs.util.PBMacros.buildEnumerableFromEmbeddedXML : 0.002s, 0%
  macro com.pblabs.util.PBMacros.embedBinaryDataResource : 0.009s, 0%
  macro com.pblabs.util.PBMacros.embedResourceXml : 0.021s, 0%
  macro de.polygonal.core.event.EventBuilder.build : 0.002s, 0%
  macro haxe.remoting.Macros.addAsyncProxyMethods : 0.012s, 0%
  macro net.amago.components.data.DataMacros.init : 0.034s, 0%
  macro typing (+init) : 0.150s, 2%
  other : 0.531s, 8%
  parsing : 0.890s, 13%
  read swf : 0.222s, 3%
  typing : 2.327s, 33%
  write swf : 0.809s, 12%


On Tue, Jul 26, 2011 at 5:06 AM, Nicolas Cannasse
<[hidden email]> wrote:

> Hi,
>
> I added in r3861 a new -D macrotimes flag that can be used together with
> --times to get precise timing of macro calls done while compiling. This can
> help you understanding how time is spent in compilation, and optimize
> accordingly.
>
> Best,
> Nicolas
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Macro Benchmarking

Nicolas Cannasse
Le 27/07/2011 01:09, Dion Whitehead Amago a écrit :
> According to the compiler output, my macros are fast, but the
> "generate swf" and "typing" are taking the longest.  On one hand,
> that's cool, because my macros are generating quite a few classes.  On
> the other hand, my compilation is still rather slow.
>
> I'm guessing no, but is there anything I could do to speed "generate
> swf" and "typing" up?  I have a fairly complex project and with 3
> -swf-lib embeds.

"Typing" is quite hard to improve since that's the core of the haXe
compiler. But I haven't yet looked at improving its speed so I'm quite
sure it could be reduced by optimizing the compiler.

However, I'm quite surprised about both your "gen swf" and "write swf"
times. This is not very common to what I'm used to deal with, even with
SWFs in the 2-4 MB range.

How big is your SWF output ? Does it contains mostly classes or graphics
assets ?

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Macro Benchmarking

Elsass Philippe
In reply to this post by Nicolas Cannasse
Nicolas,
I'll suggest you reconsider ;) a haxe "compiler shell" which would be
able to keep some things in memory.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Macro Benchmarking

Gamehaxe
Another possibility would be multi-threading - 2x to 4x should
be possible - my initial feeling is that ocaml could be well suited
to multi-threading.

Hugh

> Nicolas,
> I'll suggest you reconsider ;) a haxe "compiler shell" which would be
> able to keep some things in memory.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Macro Benchmarking

Nicolas Cannasse
Le 27/07/2011 12:16, Gamehaxe a écrit :
> Another possibility would be multi-threading - 2x to 4x should
> be possible - my initial feeling is that ocaml could be well suited
> to multi-threading.

Yes, but the issue is more that it's quite hard to have real parallel
typing / code generation algorithms.

Having a cached version of already-typed stuff is interesting, but would
require to track dependencies in a perfect manner to avoid cache-bugs,
and I haven't found an easy/nice way to implement it so far.

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Macro Benchmarking

Elsass Philippe
In reply to this post by Nicolas Cannasse
Nicolas,

Compiler cache could be an ongoing project:
- it could start with obvious things like swc/swf-lib which change
rarely and take an incompressible time to process,
- it doesn't need to be very granular: it could be applied to haxelibs
only for instance.

--
haXe - an open source web programming language
http://haxe.org