Optimize static Math expressions

10 views
Skip to first unread message

soeren

unread,
Nov 6, 2009, 4:30:00 AM11/6/09
to Closure Compiler Discuss
Hi all,
been playing with closure compiler a little bit - it's really
awesome!

Following feature suggestion (taken from current gcc):
assume having
var i = Math.cos(0)
this could be optimized to
var i = 1;

so the suggestion is to to remove unneeded calls to Math if they lead
to static results or are called with static arguments.

What do you think?

Grretings,
Soeren

Alan Leung

unread,
Nov 6, 2009, 4:36:31 AM11/6/09
to closure-comp...@googlegroups.com
Hi Soeren, glad you are enjoying our work.

Yes, the Closure Compiler team is aware of this opportunity. When the dust settle from the launch, expect even more optimizations to come.

-Alan
Reply all
Reply to author
Forward
0 new messages