Speed Writing a File

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
shadeclan
Posts: 61
Joined: 02 Jun 2011 11:29
Location: USA - Somewhere between Albany NY and Bennington VT

Re: Speed Writing a File

#16 Post by shadeclan » 12 Dec 2011 07:53

orange_batch wrote:Haha hold on, you misread what I said
Yeah, I do that a lot. :P

I suppose that removal of the comments would tend to speed up the processing of long scripts - even double-colon comments which I understand are completely ignored by the interpreter. Double-colon comments don't work inside IF statements anyway. Still, in a production environment, you want a backup copy of the code to check for changes by someone else. Keeping a copy of fully commented code, a copy of uncommented code plus the uncommented production copy might get cumbersome - especially if you have many scripts. The purpose of comments is so that anyone can look at the code and see what the app is trying to do. I think that clarity of code far outweighs any speed gains you might get through comment removal.

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: Speed Writing a File

#17 Post by orange_batch » 12 Dec 2011 13:46

Yeah, long scripts. It should speed up the goto command at least.

My current project keeps fluctuating as I add and remove modules but at the moment the main script is 30,984 bytes (921 lines) including comments, blank lines and all.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Speed Writing a File

#18 Post by Ed Dyreen » 12 Dec 2011 22:01

'
shadeclan wrote:I suppose that removal of the comments would tend to speed up the processing of long scripts
I like to comment by using a variable that indicates how something is used,
The next line will validate the code by executing it, and the validation can be easily turned off.

Code: Select all

 use: ( %%%$defines%%% r#var, r#val, #sErr ) %$n1c%
 con: Contents of $var %$n1c%
 err: 0 for succes, 1 for error "

Code: Select all

rem turned off validation ( %sharePath.declare_% $ed-serv, "\\ed-serv-0\ed-serv-0", 1 )
I prevent function slowdowns by not including much comment in that file.

Post Reply