Open Brijeshkrishna opened 1 year ago
Gonna have a look at this. I think you are raising a big point
Well I took a look for statx, calls and readlink calls, so the two are linked as we used symlink_metadata, and we kinda take all the metadata whatever happens.
I'm super curious why the original author never attempted to use at least buffered writes. There are comments about difficulties caching fs data/metadata. But either way I'm definitely interested in optimizing some of these things.
Thanks for bringing this up :+1:
Well I took a look at how we could optimize this. And tbh I think that we need to rewrite about a third of the codebase
I was also about to make a similar issue. I think that this would be a worthwhile improvement for sure. I mean in time I am sure it can be done
eza version
v0.14.1 [+git]
eza
syscall tracels
syscall traceInfo
The folder
./target/debug/deps/
( example folder , any folder with large number of files ) contains677
files. ( all numbers based on this folder ). I testedmultiple
times tocome to this
.readlink
eza
makes2708
readlink
syscalls, which all fail. This syscall takes around50-60%
of the execution time. "ls" checks whether a file is a symbolic link before callingreadlink
, while "eza" does not perform this check. (ls
as0
calls)getcwd
eza
calls thegetcwd
syscall677
times, for every file instead of caching it. (ls
as0
calls)statx
eza
calls thestatx
syscall678
times ,even when it does not need the file stats, which unnecessary. It is not printing, then why call ? (ls
as0
calls)write
eza
writes file individually, without using any bufferingSummary
ls
takes72
syscall and0.000422
seconds.eza
needs4903
syscall and0.029659
seconds.readlink
,getcwd
,statx
,write
takes around4700
syscall.eza
takes70
times moresyscalls
andtime