`pkgx` adds 300ms+ to each invocation of a tool
This doesn't matter much for some tools, but for others that are invoked a lot such as eg. C compilers in a large build, or protoc+plugins with a large number of .proto files, this can really add up.
I'm not sure where this time is spent, perhaps it's Deno bootstrap overhead?
~ $ time go version
go version go1.23.0 darwin/arm64
go version 0.00s user 0.00s system 74% cpu 0.012 total
~ $ time pkgx [email protected] version
go version go1.23.0 darwin/arm64
pkgx [email protected] version 0.20s user 0.06s system 78% cpu 0.341 total
~ $ time ~/.local/bin/go version
go version go1.23.0 darwin/arm64
~/.local/bin/go version 0.17s user 0.06s system 51% cpu 0.438 total
Should be fixed in the just released v1.2.0. If you get a chance please take a look and let us know. You will need to do a single --sync before the new cache is available.
Thanks, I gave it a shot but it seems to be roughly the same:
🐚 ~ $ pkgx --version
pkgx 1.2.0
🐚 ~ $ pkgx --sync
🐚 ~ $ time pkgx [email protected] version
go version go1.23.0 darwin/arm64
pkgx [email protected] version 0.18s user 0.10s system 75% cpu 0.377 total
🐚 ~ $ time pkgx [email protected] version
go version go1.23.0 darwin/arm64
pkgx [email protected] version 0.18s user 0.10s system 74% cpu 0.366 total
🐚 ~ $ time pkgx [email protected] version
go version go1.23.0 darwin/arm64
pkgx [email protected] version 0.18s user 0.10s system 74% cpu 0.372 total
Hmm the cache cannot be working since for me eg:
$ time pkgx go version
go version go1.22.2 darwin/arm64
real 0m0.076s
user 0m0.053s
sys 0m0.018s
$ time ~/.pkgx/go.dev/v\*/bin/go version
go version go1.22.2 darwin/arm64
real 0m0.014s
user 0m0.005s
sys 0m0.007s
So still slower but not nearly as slow as before:
$ time ~/.pkgx/pkgx.sh/v1.1/bin/pkgx go version
go version go1.22.2 darwin/arm64
real 0m0.269s
user 0m0.198s
sys 0m0.042s
Note, I ran all a few times before posting these.
When you do pkgx --sync does it say caching during the output?
When not pinning the version I get a similar result to you:
🐚 ~ $ time pkgx go version
go version go1.23.0 darwin/arm64
pkgx go version 0.04s user 0.01s system 63% cpu 0.086 total
k can reproduce, this shouldn't be the case I'll figure it out.
🙏
Has there been any development on this?
I'm on pkgx 1.3.1 and still seeing this delay.
pkgx^2 is 10-50 times faster for overhead.
Nice, thanks!