Open alecthomas opened 1 month ago
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 go@1.23.0 version
go version go1.23.0 darwin/arm64
pkgx go@1.23.0 version 0.18s user 0.10s system 75% cpu 0.377 total
🐚 ~ $ time pkgx go@1.23.0 version
go version go1.23.0 darwin/arm64
pkgx go@1.23.0 version 0.18s user 0.10s system 74% cpu 0.366 total
🐚 ~ $ time pkgx go@1.23.0 version
go version go1.23.0 darwin/arm64
pkgx go@1.23.0 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.
🙏
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?