I've mostly rewritten dead code elimination (DCE) implementation in the
compiler r4214. This should allow finer control and allow us to fix the
small bugs that were still unresolved.
I did some tests with the new implementation and things seems good so
far, but I would be interested if some of you could compile+test your
code with --dead-code-elimination to see how well it works.
In the near future, my idea is to have it as default for JS target, and
allow for the JS output to only add things such as reflection support
when the corresponding methods are used/compiled, in order to have very
small .js files when doing some very simple things.
Best,
Nicolas
Nicolas has already fixed this in rev. 4220 :)
best,
michael
After finally getting around to run a comparison, here are the results:
platform: without DCE -> with DCE (delta%)
swf8: 20kb -> 17kb (-15%)
swf9: 26kb -> 21kb (-19%)
js: 113kb -> 99kb (-13%)
neko: 99kb -> 81kb (-18%)
php: 157kb -> 138kb (-12%)
cpp: 1.107kb -> 1.033kb (-7%)
I like it!
Simon
I am curious to know: What did you compile? :)
The selecthxml unit tests. There's little custom code to optimize away
there, so above results should roughly reflect the amount of haxe std
stuff you save with DCE.
Simon
Could you report it there : http://code.google.com/p/haxe/issues ?
Thanks,
Nicolas
Should be fixed in r4350
Best,
Nicolas
Best,
Nicolas
--
I would like ot make it the default so we can showcase Haxe as a
almost-zero-overhead to-javascript compiler.
A lot of potential JS users will look at how HelloWorld.hx is generated.
If it takes too much JS output, they will - wrongly - assume that it
will not scale well.
Best,
Nicolas
Best,
Nicolas
Le 17/04/2012 18:58, Franco Ponticelli a �crit :
You still will be able to disable DCE of course ;)
Best,
Nicolas
Best,
Nicolas
--js-modern activates strict mode and should work with Google Closure.
Best,
Nicolas
Best,
Nicolas