1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

When is compilation ("BatComp") worthwhile?

Discussion in 'Support' started by mathewsdw@sbcglobal.net, Mar 13, 2009.

  1. I thought I would look into batch-file compilation (I have written over 100 batch files since first getting 4NT many years ago), so I compiled all of my batch files in a "For" loop. While I got some messages essentially saying that the .BAT file was "too small" for compilation to be worthwhile, I noticed that all of the original .BAT files also each fit into a single cluster (4K) on the hard-drive, as do (of course) the corresponding ".BTM" files. This being the case, is it really worthwhile to compile .BAT files that fit into a single cluster? While I don't imagine there'll be an improvement in "load" time (a single cluster is the smallest unit of disk-drive I/O), there might be an advantage in terms of batch-file "parse" time. (And I have to ask - how many people write .BAT files that are larger than 4K? I certainly don't, and since the batch file language is now essentially what (used to be) called a "high-level language" I am writing some pretty large (but less than 4K! ; > ) batch files. (I am a C++ programmer by trade, and batch files are certainly much easier to write to do DOS things than are C++ programs!)
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    May 20, 2008
    Likes Received:
    Re: When is compilation ("BatComp") worthwhile?

    BATCOMP isn't a compiler, it's a compressor.

    Yes, batch files do sometimes grow large enough to make compression worthwhile, but I think the major advantage is obfuscation. If you have a batch file containing e.g. passwords, compressing it with BATCOMP and using the /E option will make them far less obvious to the casual user.
  3. rconn

    rconn Administrator
    Staff Member

    May 14, 2008
    Likes Received:
    BATCOMP stands for "batch compressor", not "batch compiler".

    It's purpose is to prevent end users from modifying (deliberately or
    inadvertently) batch files, not to make them faster or (significantly)
    smaller. This was requested by some IT departments that wanted to
    distribute batch files but were afraid of their smartest (& dumbest?) users
    rewriting them.

    And yes, I know of some TCC users who have some *very* large batch files!

    Rex Conn
    JP Software
  4. Thanks, Rex. My mistake! ; > ) (Althought I do sort of wonder when/why/how that happened...)

Share This Page