[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [amibroker] Re: AFL programming style questions comments /* */ vs. //


  • To: Dennis Brown <amibroker@xxxxxxxxxxxxxxx>
  • Subject: Re[2]: [amibroker] Re: AFL programming style questions comments /* */ vs. //
  • From: Herman <psytek@xxxxxxxx>
  • Date: Tue, 5 Aug 2008 16:07:51 -0400

PureBytes Links

Trading Reference Links

Title: Re[2]: [amibroker] Re: AFL programming style questions comments /* */ vs. //

A manual toggle option to remove comments would not only help the user. If the same switch were applied when transferring code to the AmiBroker engine the effect comments on execution time due to comments would be eliminated all together. However, in my work the effect is negligible. 


The pursuit of super execution speeds is interesting. However I suspect that super computing power will, if not used carefully, lead to over-optimization. 

imo, If you run millions and millions of tests the change of eventually finding one or more Black Swans becomes a certainty.


Best regards,

herman


Tuesday, August 5, 2008, 3:44:56 PM, you wrote:


> Tuzo, Joe,


> So if I understand this correctly, in my code I use many loops for  

> complex functions and comment many lines because of the complexity.   

> If each line I comment takes 100 ns and I am running a 50,000 bar  

> backtest, I could end up with 800 ms of time wasted in // comments!


> Since the /* */ comments are removed once when the formula is loaded,

> they are not going to affect these times.


> I don't think I am wasting that much time in // comments though,  

> because that would mean that half my execution time was skipping  

> comments and I don't think that is reasonable.  Looking over some of  

> my loops, I can see that I kept the comments on lines inside the loops

> to a minimum.


> Still, I would like to comment my code freely without thinking that my

> comments are hurting the execution speed.


> That means that I need to use /* */ comments for code unless the //  

> EOL comments are also removed once when loaded.


> BR,

> Dennis


> On Aug 5, 2008, at 3:25 PM, tuzo_wilson wrote:

>> Joseph,


>> Thanks for digging that up...my Yahoo search came up empty.


>> If I'm reading the above correctly, C++ style comments are actually

>> *faster* than C style (for a single line).  /* */ block comments over

>> multiple lines may be faster in that scenario.


>> Either way, those numbers are quite small so, IMO, it would be better

>> to use C++ // style comments exclusively.  Then in the case when

>> debugging is required whole code blocks can easily be commented out

>> with /* */ comments.



>> Tuzo



>> --- In amibroker@xxxxxxxxxxxxxxx, "J. Biran" <jbiran@xxx> wrote:


>>> It was first mentioned in release notes for AB 4.88. also

>>> quoting from another message:

>>>> -----Original Message-----

>>>> From: AmiBroker-at@xxxxxxxxxxxxxxx On Behalf Of Tomasz

>>> Janeczko

>>>> Sent: Friday, October 20, 2006 12:32 PM

>>>> To: AmiBroker-at@xxxxxxxxxxxxxxx

>>>> Subject: Re: [AmiBroker-at] Re: Conditional #include


>>>> Hello,


>>>> I took a look at code part that handles comments and

>>> improved

>>>> it now, so single line of /* */ comment takes now 0.14

>>> microseconds,

>>>> when single line of // comment takes 0.10 microseconds.


>>>> Best regards,

>>>> Tomasz Janeczko

>>>> amibroker.com


>>> I am glad I bothered searching for the original information.

>>> I somehow remembered the numbers were in milliseconds not

>>> microseconds. Ok, I will be able to sleep better now ;)



> ------------------------------------


> Please note that this group is for discussion between users only.


> To get support from AmiBroker please send an e-mail directly to 

> SUPPORT {at} amibroker.com


> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:

> http://www.amibroker.com/devlog/


> For other support material please check also:

> http://www.amibroker.com/support.html

> Yahoo! Groups Links


> <*> To visit your group on the web, go to:

>     http://groups.yahoo.com/group/amibroker/


> <*> Your email settings:

>     Individual Email | Traditional


> <*> To change settings online go to:

>     http://groups.yahoo.com/group/amibroker/join

>     (Yahoo! ID required)


> <*> To change settings via email:

>     mailto:amibroker-digest@xxxxxxxxxxxxxxx 

>     mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx


> <*> To unsubscribe from this group, send an email to:

>     amibroker-unsubscribe@xxxxxxxxxxxxxxx


> <*> Your use of Yahoo! Groups is subject to:

>     http://docs.yahoo.com/info/terms/



__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___