- Feb
- 38
- 0
I have a project with a very large directory tree. Let's say I want to get a list of directories where there are *.obj files.
I.e. it takes TCC 23 minutes to do.
An equivalent command in PowerShell takes just 30 seconds:
In Linux in the same tree on the same PC (on a virtual machine) a bash equivalent takes about one and half minutes:
It takes a bit longer than PowerShell, but Linux after all runs three processes for each directory and the hard drive is virtual. However it is still 15 times faster than TCC.
I experimented with the latest version of TCC, all files are located on a local hard drive.
Code:
echo %time & global /i/q (ffind /u *.obj > NUL & if 0 == %_? (echo %@full[.])) & echo %time
11:03:12,37
<< skipped >>
11:26:07,05
An equivalent command in PowerShell takes just 30 seconds:
Code:
Measure-Command { Get-ChildItem -Recurse -Directory | ForEach-Object { If (Join-Path -ChildPath *.obj -Path $_.FullName | Test-Path) { echo $_.FullName } } }
Days : 0
Hours : 0
Minutes : 0
Seconds : 29
Milliseconds : 677
In Linux in the same tree on the same PC (on a virtual machine) a bash equivalent takes about one and half minutes:
Code:
$ time find -type d -print0 | xargs -0 -n 1 -I{} bash -c 'if [[ -n "$(find '"'"'{}'"'"' -maxdepth 1 -name '"'"'*.obj'"'"' -print -quit)" ]]; then echo {}; fi'
./tools/win32/msvc90/lib
real 1m36.002s
user 0m16.651s
sys 1m25.930s
I experimented with the latest version of TCC, all files are located on a local hard drive.
Last edited: