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

Transient TCCs slow compared to transient CMDs

Discussion in 'Support' started by nickles, May 27, 2009.

  1. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    Preface: When calling GVim in diff mode (the program used is not really of importance...) GVim would open two transient shells one by one.

    If I call GVim from cmd (COMSPEC=...cmd.exe) it would open the diff (for a specific combination of files) immediately; you merely see two black windows pop up and disappear.

    Doing the same from tcc (even if the first command in tcstart.cmd is "cancel") the startup takes *considerably* longer.

    I assume this is due to license checking issues.
    In case JPSoft can confirm this, would it be possible to skip these checks for shells with %_TRANSIENT = 1?

    nickles
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    It is not possible to skip the registration check; that is done before any of the TCC code is loaded or executed.

    However, the registration check takes about 30ms on an average machine, so that's not going to be your problem. Loading TCC and all of its dll's (many many many more than CMD loads) usually takes about 100-150 ms. If you're seeing a substantially longer load time it's probably due to your TCSTART and/or TCMD.INI settings.
     
  3. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    After your answer I fiddled around and used procmon to find that even when starting tcc with the /c switch, about 5000(!) write operations (FASTIO_WRITE) on the defined history file (with an average size of about 20(!!!) bytes) were made (as compared to about 20 read operations with an average size of 4096 bytes).

    tcmd.ini doesn't seem to be an issue at all, because - according to the log - it was not read in transient mode.

    These findings might very well explain the slow startup behavior.

    So, the question seems to be if there is a way to prevent tcc from writing to the HIS file in transient mode (or if this make sense at all)...

    nickles
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    On Fri, 05 Jun 2009 12:10:53 -0500, nickles <> wrote:

    |So, the question seems to be if there is a way to prevent tcc from writing to the HIS file in transient mode (or if this make sense at all)...

    If you're loading a history file in tcstart.btm, you could

    if %_transient NE 1 .and. %_pipe NE 1 history /r ...

    If it suits you, consider using SHRALIAS. It keeps all the lists (hist,
    dirhist, alias, function) in memory while no instance of TCC is running. If you
    start TCC using global lists (INI directive) they're already in place.
    --
    - Vince
     
  5. Stephen Howe

    Joined:
    Jun 7, 2008
    Messages:
    121
    Likes Received:
    0
    Vince, is all of this in the Wiki?

    If it is not, it would nice to have "model" tcstart.btm & tcexit.btm's in the Wiki, which have remmed out commands and comments with the pros/cons as to why you want such a command in tcstart.btm & tcexit.btm.

    Intermediate users of TCC would get a leg up as to what is "best practice" for TCC, what makes it faster etc.

    Cheers

    Stephen Howe
     
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    On Fri, 05 Jun 2009 16:00:43 -0500, Stephen Howe <> wrote:

    |---Quote---
    |
    |If you're loading a history file in tcstart.btm, you could
    |
    |if %_transient NE 1 .and. %_pipe NE 1 history /r ...
    |
    |If it suits you, consider using SHRALIAS. It keeps all the lists (hist,
    |dirhist, alias, function) in memory while no instance of TCC is running. If you
    |start TCC using global lists (INI directive) they're already in place.
    |---End Quote---
    |
    |Vince, is all of this in the Wiki?
    |
    |If it is not, it would nice to have "model" tcstart.btm & tcexit.btm's in the Wiki, which have remmed out commands and comments with the pros/cons as to why you want such a command in tcstart.btm & tcexit.btm.
    |
    |Intermediate users of TCC would get a leg up as to what is "best practice" for TCC, what makes it faster etc.

    I know nothing of the wiki. I imagine the useful things folks do in TCSTART and
    TCEXIT are very numerous and site-particular. As for what's "best" ... who
    knows?
    --
    - Vince
     
  7. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    Thanks for the answer Vince.

    ...however...

    I forgot to mention that I

    1) always keep open at least one instance of tcc.exe (not using sharealias)
    2) tested this with the /i switch[es] and an tcstart.btm containing a "cancel" after the initial "@echo off"

    Same results. I'm wondering why tcc would perform such a lot of small writes to the history file for a transient shell (even for an interactive one this doesn't seem to make much sense anyway...)

    I'd rather see this behavior changed or be able to switch it off.

    nickles
     

Share This Page