TCC/LE Causing 99% CPU Spikes and DIR Delays

PAB

Nov 9, 2008
4
0
I am using TCC/LE 9.02.154 on Windows XP SP3 (though the problem I'm about to describe affects previous versions and other platforms too).

My primary reason for using TCC/LE is to show certain file types in various colors, but I am seeing major CPU spikes and long delays when trying to associate colors with a large number of extensions.

I am using a TCSTART.BAT file (renamed and attached) in the TCC/LE program directory and defining my color choices with "set colordir=". But the more extensions I assign colors to, the worse TCC/LE behaves.

For example, if I assign multiple various colors to a total of 710 extensions and then issue a DIR command within C:\WINDOWS\system32\, there is a 20 second pause before TCC/LE starts listing the files - and during that time, tcc.exe will be utilizing 99% of the CPU.

If I drop down to 130 extensions, however, the same command then takes 3 seconds to start - so it's obviously just an issue with the number of extensions being used.

Naturally the more files there are in a directory, the longer the delay before listing will be. And even after a listing, any relisting will take just as long - implying there is no form of caching going on. I've even seen larger directories take one minute or longer to start listing.

Is there any chance this is a bug which can be fixed or maybe a code issue which can be compensated for in some way?

Or is this problem a design limitation of the software?
 

Attachments

  • TCSTART.TXT
    5.1 KB · Views: 109

rconn

Administrator
Staff member
May 14, 2008
12,315
148
I am using TCC/LE 9.02.154 on Windows XP SP3 (though the problem I'm about to describe affects previous versions and other platforms too).

My primary reason for using TCC/LE is to show certain file types in various colors, but I am seeing major CPU spikes and long delays when trying to associate colors with a large number of extensions.

I am using a TCSTART.BAT file (renamed and attached) in the TCC/LE program directory and defining my color choices with "set colordir=". But the more extensions I assign colors to, the worse TCC/LE behaves.

For example, if I assign multiple various colors to a total of 710 extensions and then issue a DIR command within C:\WINDOWS\system32\, there is a 20 second pause before TCC/LE starts listing the files - and during that time, tcc.exe will be utilizing 99% of the CPU.

If I drop down to 130 extensions, however, the same command then takes 3 seconds to start - so it's obviously just an issue with the number of extensions being used.

Naturally the more files there are in a directory, the longer the delay before listing will be. And even after a listing, any relisting will take just as long - implying there is no form of caching going on. I've even seen larger directories take one minute or longer to start listing.

Is there any chance this is a bug which can be fixed or maybe a code issue which can be compensated for in some way?

Or is this problem a design limitation of the software?

710 extensions is pretty extravagant; I don't think I've ever seen anybody using 1/10 as many before.

I'm afraid that's the way it's designed -- the colorization code has to check for a lot of options (extension, attributes, and boolean operators) for each extension. For a large directory, there's a whole lot of crunching going on.

Note that you can use wildcards in the extensions, so you ought to be able to reduce your total somewhat.
 

PAB

Nov 9, 2008
4
0
710 extensions is pretty extravagant; I don't think I've ever seen anybody using 1/10 as many before.

I'm afraid that's the way it's designed -- the colorization code has to check for a lot of options (extension, attributes, and boolean operators) for each extension. For a large directory, there's a whole lot of crunching going on.

Note that you can use wildcards in the extensions, so you ought to be able to reduce your total somewhat.

OK, thanks very much for responding Rex. I appreciate it.
 
May 20, 2008
603
0
Sammamish, WA
> I am using a TCSTART.BAT file (renamed and attached) in the TCC/LE program directory and defining my color choices with "set colordir=". But the more extensions I assign colors to, the worse TCC/LE behaves.


> Or is this problem a design limitation of the software?

On my machine, it takes 9.71 seconds to do the DIR using your file.
Curiously, using my DIR replacement and the same colorization, it only
takes 0.89 seconds. I'm not using anything more clever than a linked
list to lookup, so I can't imagine what Rex might be doing.

Without any colorization, 4NT takes 0.25 seconds.

--
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
Measure wealth by the things you have for which you would not take money.
 
May 30, 2008
42
0
From: JP Software Forums [mailto:neil@jpsoft.com]
Sent: Sunday, November 09, 2008 11:59 PM
Subject: [Support-t-631] TCC/LE Causing 99% CPU Spikes and DIR Delays

>
> For example, if I assign multiple various colors to a total of 710
> extensions and then issue a DIR command within C:\WINDOWS\system32\,
> there is a 20 second pause before TCC/LE starts listing the files - and
> during that time, tcc.exe will be utilizing 99% of the CPU.
>
> If I drop down to 130 extensions, however, the same command then takes 3
> seconds to start - so it's obviously just an issue with the number of
> extensions being used.

I have a feeling Rex doesn't believe in hash tables. Similar slowdowns occur
in 4NT/TCC when you have large (even moderate) numbers of aliases or
functions, even if they're provided by plugins.

Jonathan Gilbert
 
May 20, 2008
603
0
Sammamish, WA
>> My primary reason for using TCC/LE is to show certain file types in various colors, but I am seeing major CPU spikes and long delays when trying to associate colors with a large number of extensions.


> Rex said:
> I'm afraid that's the way it's designed -- the colorization code has to check for a lot of options (extension, attributes, and boolean operators) for each extension. For a large directory, there's a whole lot of crunching going on.

If you are just trying to get a colorized output, and can live with a
program that will only match on extension, not the extensive set that
Rex supports, you could try my timedir program at
http://jcook.net/timedir

I tried to have most options behave like 4NT's DIR/PDIR do. It has
some things that DIR doesn't, and doesn't have some things that DIR
does.

Anyway, in my own tests for the one colorization file you sent, the
syntax is very close to the same and timedir performed very much
quicker. Perhaps it'll be useful. The "hidden" attribute you use is
not supported by timedir at this time, and will simply look for an
extension of ".hidden"

--
Jim Cook
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
 
May 20, 2008
603
0
Sammamish, WA
> If you are just trying to get a colorized output, and can live with a
> program that will only match on extension, not the extensive set that
> Rex supports, you could try my timedir program at
> http://jcook.net/timedir

I updated version 5.73 to handle attributes as well.

--
Jim Cook
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
 

PAB

Nov 9, 2008
4
0
I updated version 5.73 to handle attributes as well.

Belated thanks Jim, I just downloaded TIMEDIR version 5.80 and this seems to work well for me. Even with all of the extensions I have defined there are no noticable DIR delays or CPU spikes.

Two questions though:

1. Would it be possible to add support for "InputColors" (for input text color) and "ErrorColors" (for error message text color)?

After my original post, I also added the following to my TCSTART.BAT file:

option //InputColors=bright white on black
option //ErrorColors=black on bright red

and find this to be extremely useful. I realize these are general CMD shell colors whereas TIMEDIR is strictly specific to the DIR command, but I figure it doesn't hurt to ask. :)

2. How would I configure a system to (a) always use TIMEDIR instead of DIR whenever I issue the DIR command and (b) always have TIMEDIR automatically start with some necessary parameters (in my case, "/R:C:\PROGRA~1\TimeDir\TDCOLORS.CFG /A")?

Right now, I add the "DIRCMD" system variable set to "/o:gn /a" within my Environment Variables (under the System Properties panel). But as far as I can tell, TIMEDIR isn't honoring that global /A parameter used by DIR (and only appears to honor /O:GN because that also happens to be a default in TIMEDIR).

Just FYI, I did also find one minor incompatibility issue. Bracketed wildcards are not processed the way TCC/LE handles them. For example, ra[r01] should equal rar, ra0, and ra1 and r[012]* should equal r0*, r1*, and r2*. But such "[ ]" combinations do not work with TIMEDIR. This is no big deal, however, since you can just explicitly define each individual extension instead - but it is a compatibility difference worth noting.

Thanks very much.
 

Attachments

  • TDCOLORS.TXT
    5.2 KB · Views: 124
May 20, 2008
603
0
Sammamish, WA
> 2. How would I configure a system to (a) always use TIMEDIR instead of DIR

If you want to replace the default behavior of any command, built-in
or external, you should use an alias.

For the rest of the TIMEDIR specific questions, please email me at jim
at jcook dot net and I'll gladly discuss details. I couldn't see your
direct email address in any of the headers.


--
Jim Cook
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
 
May 20, 2008
603
0
Sammamish, WA
> Right now, I add the "DIRCMD" system variable set to "/o:gn /a" within my Environment Variables (under the System Properties panel). But as far as I can tell,

According to the DIRCMD help and my testing, the DIRCMD system
variable is not honored in 4NT.

Topic "dircmd.htm" last edited 1/27/2008

"The DIRCMD variable is used by some versions of CMD.EXE to hold
default options for the DIR command. TCC does not directly support
this variable."

--
Jim Cook
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
 

PAB

Nov 9, 2008
4
0
Duh... Nevermind... I should have gotten some sleep before posting. :)

After waking up, I realized that all I really needed to do was add this:
@alias dir=*C:\PROGRA~1\TimeDir\timedir /R:C:\PROGRA~1\TimeDir\TDCOLORS.CFG /A
to my TCSTART.BAT file and remove all the "COLORDIR" entries.

Now I get TCC/LE with all the colors I want and no performance issues... :D

Thanks again Jim!

PS: I was only using DIRCMD with the OS Command Prompt. I also had to use an alias entry in TCSTART.BAT for the same support in TCC/LE. Sorry for not being more clear about that.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
PAB wrote:
| ...
| to my TCSTART.BAT file

Note that using either the .BAT or the .CMD extension results in slower
execution than using .BTM. .BTM files are copied into internal storage in
their entirety, and executed thence. .BAT and .CMD files are read one line
at a time to support self-modifying batch files.
--
HTH, Steve
 
Similar threads
Thread starter Title Forum Replies Date
Jesse Heines Request for TCC Date Command Custom Format Example TCC/LE Support 4
P TCC LE crashes without any info after recent windows updates TCC/LE Support 2
V TCC LE doesn't expand %~ff correctly TCC/LE Support 5
A vcvarsall.bat command not working on TCC LE command prompt TCC/LE Support 16
M DEBUG dialogs from TCC TCC/LE Support 1
Captain'Flam False condition in IF force loop exit (TCC/LE 14 64bits) TCC/LE Support 3
M How to get the number of chars, which fit in the currently displayed TCC-window? TCC/LE Support 3
M TCC/LE works with Windows Insider Skip Ahead Build 17618 TCC/LE Support 1
D Bug with TCC/LE and volumes mounted under directories TCC/LE Support 5
B Error in TCC/LE when succeed smoothly in native windows cmd.exe TCC/LE Support 6
A TCC/LE x64 no longer works with Windows 10 Insider Preview Build 17063 TCC/LE Support 7
adam_0 TCC/LE string replacement differing from cmd.exe TCC/LE Support 3
D Incorrect icon for TCC/LE prompt here, Windows 10 TCC/LE Support 5
B Run TCC without interactive logon TCC/LE Support 0
T WAD option /u on TCC LE 13.06.77 TCC/LE Support 2
B Copy command to set timestamp not working in TCC/LE TCC/LE Support 5
R WAD TCC/LE does not set %_ffind_files TCC/LE Support 1
P Window width TCC TCC/LE Support 3
A installer for latest tcc/le isn't working TCC/LE Support 0
M Any plans for an updated TCC/LE version TCC/LE Support 16
miXza-81 Fixed There is Batch breaking bug in TCC LE (x64) TCC/LE Support 9
M Getting started with TCC/LE TCC/LE Support 3
John A TCC/LE not finding files in the c:\windows\system32\ directory? TCC/LE Support 4
Tim Rowe How to? TCC/LE colour not working with RSpec TCC/LE Support 14
R converting from NT to TCC/LE TCC/LE Support 3
jbanaszczyk [Q] How to retrieve / set current TCC/LE language TCC/LE Support 1
T C# Process.Start() never ends when starting TCC/LE process? TCC/LE Support 5
R WAD TCC LE pipe fails TCC/LE Support 6
M TCC LE x64 13.0 crash in Win 8 Pro 64-bit TCC/LE Support 0
A ftp on tcc/le TCC/LE Support 2
B What are the TCC settings that will allow maximum cmd.exe compatibility? TCC/LE Support 11
R TCC/LE attrib +/- C? TCC/LE Support 6
S Just wondering what TCC/LE 13.05.68 fixed TCC/LE Support 1
R TCC/LE steals the .btm association? TCC/LE Support 1
S Fixed TCC-LE 13.05.65 x64 "option" command tabs broken TCC/LE Support 4
rconn News TCC/LE 13.05 Released TCC/LE Support 0
F WAD Different value for %~dpfsI in TCC/LE TCC/LE Support 2
Charles Dye ? command, TCC/LE vs. supported TCC/LE Support 3
B TCC/LE prompt here TCC/LE Support 1
G Pin TCC/LE to task bar and start menu TCC/LE Support 6
jason404 A particular program that I like to use no longer works in TCC/LE TCC/LE Support 25
rconn News TCC/LE 13.04.56 Released TCC/LE Support 0
rconn News TCC/LE 13.04.55 Released TCC/LE Support 0
F Problem with TCC window colors TCC/LE Support 3
rconn News TCC/LE Version 13.03.45 Released TCC/LE Support 0
mfarah Things from the full TCC that I'd like to see in TCC/LE. TCC/LE Support 7
N how to terminate tcc/le using /h TCC/LE Support 15
rconn News TCC/LE Version 13.03.40 Released TCC/LE Support 0
rconn News TCC/LE 13.03.39 Released TCC/LE Support 0
R How to? Add TCC Open command box here to context menu TCC/LE Support 2

Similar threads