msys2 / msys2-runtime

Our friendly fork of Cygwin 💖 https://cygwin.org 💖 see the wiki for details
https://github.com/msys2/msys2-runtime/wiki
GNU General Public License v2.0
183 stars 39 forks source link

Is it possible to increase program execution speed by caching the result of path conversion #193

Closed heheda123123 closed 7 months ago

heheda123123 commented 8 months ago

Every time I execute pacman, it always feels much slower than on archlinux. This is very strange, so I used strace -o xx.txt pacman -Syu to track the execution process of pacman.
image You can see that there are a lot of path conversion operations. After grep filtering, you can see that executing pacman -Syu triggered 2,500 path conversion operations. image And as can be seen from the figure, the path transformations performed are often repeated. image Is it possible to increase program execution speed by caching the result of path conversion.

heheda123123 commented 8 months ago

Or is it possible to determine the current execution environment before starting the program? If in msys2 shell, use the posix path directly. else use the windows execution path directly.