Big Macros Speedup

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

Big Macros Speedup

Nicolas Cannasse
Hi,

FYI, I made several improvements to the haXe compiler macro engine
between r3855 and r3859 (included), which should improve the execution
speed of macros by more than 2

Testing is required in order to ensure that I have not broken anything
without noticing (already did some extensive tests but never knows).

Best,
Nicolas

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

Re: Big Macros Speedup

Justin Donaldson-3
That's great!  I avoided using some macros because it made the compiler sluggish... I'll revisit them.  it's amazing how much a fast compiler aids development.

-Justin

On Fri, Jul 22, 2011 at 2:26 PM, Nicolas Cannasse <[hidden email]> wrote:
Hi,

FYI, I made several improvements to the haXe compiler macro engine between r3855 and r3859 (included), which should improve the execution speed of macros by more than 2

Testing is required in order to ensure that I have not broken anything without noticing (already did some extensive tests but never knows).

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: Big Macros Speedup

Nicolas Cannasse
Le 23/07/2011 00:21, Justin Donaldson a écrit :
> That's great!  I avoided using some macros because it made the compiler
> sluggish... I'll revisit them.  it's amazing how much a fast compiler
> aids development.

A few tips for macro speedup :

a) try to limit the amount of code that is compiled within the macro
context, since it needs to be compiled separately from your main context
(swf, js, etc.)

b) try to disable some of the processing when Context.defined("display")
is set, which is when compiler is used with completion.

Nicolas

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

Re: Big Macros Speedup

go2ghana
Am 23.07.2011 09:35, schrieb Nicolas Cannasse:

> Le 23/07/2011 00:21, Justin Donaldson a écrit :
>> That's great!  I avoided using some macros because it made the compiler
>> sluggish... I'll revisit them.  it's amazing how much a fast compiler
>> aids development.
>
> A few tips for macro speedup :
>
> a) try to limit the amount of code that is compiled within the macro
> context, since it needs to be compiled separately from your main
> context (swf, js, etc.)
>
> b) try to disable some of the processing when
> Context.defined("display") is set, which is when compiler is used with
> completion.
Any example how can this be done?

Axel
>
> Nicolas
>


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

Re: Big Macros Speedup

Nicolas Cannasse
Le 23/07/2011 10:03, Axel Huizinga a écrit :
>> b) try to disable some of the processing when
>> Context.defined("display") is set, which is when compiler is used with
>> completion.
> Any example how can this be done?

Test Context.defined("display") in your macro and do less stuff if it's set.

Nicolas

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

Re: Big Macros Speedup

Dion Whitehead Amago
Awesome!  I notice a small but significant speed improvement and I use
a lot of macros.


>>> b) try to disable some of the processing when
>>> Context.defined("display") is set, which is when compiler is used with
>>> completion.
>>
>> Any example how can this be done?
>
> Test Context.defined("display") in your macro and do less stuff if it's set.

If I understand this correctly, this isn't much help if most of your
macros are building class members right?  Since those classes need to
be built for code completion to work correctly?

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

Re: Big Macros Speedup

Justin Donaldson-3
In reply to this post by Nicolas Cannasse
Thanks for the tips.

On Sat, Jul 23, 2011 at 12:35 AM, Nicolas Cannasse <[hidden email]> wrote:
Le 23/07/2011 00:21, Justin Donaldson a écrit :

That's great!  I avoided using some macros because it made the compiler
sluggish... I'll revisit them.  it's amazing how much a fast compiler
aids development.

A few tips for macro speedup :

a) try to limit the amount of code that is compiled within the macro context, since it needs to be compiled separately from your main context (swf, js, etc.)

b) try to disable some of the processing when Context.defined("display") is set, which is when compiler is used with completion.


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: Big Macros Speedup

Nicolas Cannasse
In reply to this post by Dion Whitehead Amago
Le 24/07/2011 01:26, Dion Whitehead Amago a écrit :

>>>> b) try to disable some of the processing when
>>>> Context.defined("display") is set, which is when compiler is used with
>>>> completion.
>>>
>>> Any example how can this be done?
>>
>> Test Context.defined("display") in your macro and do less stuff if it's set.
>
> If I understand this correctly, this isn't much help if most of your
> macros are building class members right?  Since those classes need to
> be built for code completion to work correctly?

Yes.

What you can do is for instance cache the latest successfully built
members in a file and reuse this cache in case of completion.

Nicolas

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