Skip to main content
Participant
March 11, 2008
Question

Flex Compiler efficiency

  • March 11, 2008
  • 7 replies
  • 1082 views
Hi All,



is Flex compiler efficient in reusing of code i.e.



If I write following chunk of code what how these get compiled



Y=a.y.getTime();

X=a.y.getTime();



Whether flex compiler will replace one statement for above two same expressions or not?

As



Var time= a.y.getTime();

Y= time;

X= time;





Thanks & Regards,



Neelam
This topic has been closed for replies.

7 replies

Participant
March 12, 2008
Hi Hazhir,

fcsh reads input from java.lang.System.in. As far as I know, it should work fine from a shell script (e.g. fcsh < commands.txt). In fact, that's how Flex QA automates their compiler testing works (i.e. by using unix shell scripts and fcsh).

I don't know what should be coded in Perl to make fcsh receive the compiler commands from System.in, but I think it's doable.

Hope this helps.

-C
Participant
March 12, 2008
Hi Neelam,

Does getTime() return something that changes over time? If so, your 'optimization' may cause your code to run incorrectly.

The Flex compiler does not currently optimize codes in this and other similar situations. Well, I doubt it ever will because I believe the VM in the Player at runtime can do a much better job optimizing the bytecodes. That said, the VM in the current Player does not do much in this area either - expect some kind of on-the-fly code optimizations in the next version of VM.

If you're interested in knowing how the VM optimizes your code on-the-fly at runtime for better performance, you may check out the Mozilla Tamarin project and post questions there.

Hope this helps.

-C
Participating Frequently
March 12, 2008
What are you trying to do? Are you trying to automate recompiling a file quickly using fcsh, e.g. on a server? Maybe you should look into the web-tier compiler.

- Jono




From: Hazhir Haghshenas <member@adobeforums.com>

Reply-To: <flexsdk-dev@adobeforums.com>

Date: Tue, 11 Mar 2008 16:38:12 -0700

To: <flexsdk-dev@adobeforums.com>

Subject: Re: Flex Compiler efficiency



A new message was posted by Hazhir Haghshenas in



Developers --

  Flex Compiler efficiency



SOME BODY HELP Me PLEASE...

hi,



need execute fcsh compiler from some script for example from perl script!



when i did by exec() or system() function, the script just hang's up  :(! and wait's for some parameters from out side :((!



can i send a "mxml somefile.mxml" command from my script to fcsh???



why adobe made fcsh like that?

they don't think about status when some file or module will compile in runtime by some script?



in case "Use mxml.exe or mxml.jar" i have the answer:

these files executes very slowly!!! :(( :((



HELP ME PLEASE!!!!




View/reply at Flex Compiler efficiency <http://www.adobeforums.com/webx?13@@.59b4a370/3>

Replies by email are OK.

Use the unsubscribe <http://www.adobeforums.com/webx?280@@.59b4a370!folder=.3c060fa3>  form to cancel your email subscription.





Participant
March 11, 2008
SOME BODY HELP Me PLEASE...
hi,

i need execute fcsh compiler from some script for example from perl script!

when i did by exec() or system() function, the script just hang's up :(! and wait's for some parameters from out side :((!

can i send a "mxml somefile.mxml" command from my script to fcsh???

why adobe made fcsh like that?
they don't think about status when some file or module will compile in runtime by some script?

in case "Use mxml.exe or mxml.jar" i have the answer:
these files executes very slowly!!! :(( :((

HELP ME PLEASE!!!!
Inspiring
March 11, 2008
On Tuesday 11 Mar 2008, Jono Spiro wrote:
> What you're saving here is looking up a, y, getTime, and then calling
> a function that may have side effects (which is why I say they are not
> equivalent).

That's probably why the compile might not optimise out multiple call/lookups
in the same method - it doesn't know if there is a side effect or not.

--
Tom Chiverton

****************************************************

This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.
Participating Frequently
March 11, 2008
This might not be a good example because I doubt that those are <br />equivalent statements versus calling the function three times.<br /><br />What you're saving here is looking up a, y, getTime, and then calling <br />a function that may have side effects (which is why I say they are not <br />equivalent). You'd have to do this three times without keeping the <br />return value, which is obviously more expensive.<br /><br />You could save some code by using a local function, but it'd have to <br />be saving a considerable amount of duplication to outweigh the overhead.<br /><br />Jono<br /><br /><br />On Mar 11, 2008, at 2:16 AM, Tom Chiverton <member@adobeforums.com> <br />wrote:<br /><br />> A new message was posted by Tom Chiverton in<br />><br />> Developers --<br />> Flex Compiler efficiency<br />><br />> On Tuesday 11 Mar 2008, neelam verma wrote:<br />>> Var time= a.y.getTime();<br />>> Y= time;<br />>> X= time;<br />><br />> I remember reading somewhere that you should minimise function calls/ <br />> array<br />> lookups in your code, by doing just this.<br />><br />> -- <br />> Tom Chiverton<br />><br />> ****************************************************<br />><br />> This email is sent for and on behalf of Halliwells LLP.<br />><br />> Halliwells LLP is a limited liability partnership registered in <br />> England and Wales under registered number OC307980 whose registered <br />> office address is at Halliwells LLP, 3 Hardman Square, <br />> Spinningfields, Manchester, M3 3EB. A list of members is available <br />> for inspection at the registered office. Any reference to a partner <br />> in relation to Halliwells LLP means a member of Halliwells LLP. <br />> Regulated by The Solicitors Regulation Authority.<br />><br />> CONFIDENTIALITY<br />><br />> This email is intended only for the use of the addressee named above <br />> and may be confidential or legally privileged. If you are not the <br />> addressee you must not read it and must not use any information <br />> contained in nor copy it nor inform any person other than Halliwells <br />> LLP or the addressee of its existence or contents. If you have <br />> received this email in error please delete it and notify Halliwells <br />> LLP IT Department on 0870 365 2500.<br />><br />> For more information about Halliwells LLP visit www.halliwells.com.<br />><br />><br />> ------------------------------------------------------<br />> View/reply at <a href=http://www.adobeforums.com/webx?13@@.59b4a370/0><br />> Replies by email are OK.<br />> Use the unsubscribe form at <a href=http://www.adobeforums.com/webx?280@@.59b4a370!folder=.3c060fa3 <br />> > to cancel your email subscription.
Inspiring
March 11, 2008
On Tuesday 11 Mar 2008, neelam verma wrote:
> Var time= a.y.getTime();
> Y= time;
> X= time;

I remember reading somewhere that you should minimise function calls/array
lookups in your code, by doing just this.

--
Tom Chiverton

****************************************************

This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.