Comments (8)
Agreed. First, i'll point out that this can already be solved by providing your own projects.json
file via the --projects-file
argument, although I admit this is not an optimal solution for this problem. On the other hand tools like cpanm
do not seem to require you to update your project list manually which is advantageous to the user (but then again I have no problem with tools like apt-get
needing to be updated manually either). So I think the best solution may be to finally add a config file for keeping state, and allowing zef to be configured to a number-of-days between auto updating its cache (or 0 to do it every time) as well as a --update
option to manually override.
Speed
The Initialization message at the start is shown so the user does not think the program is frozen when you start it, but is not tied to network activity.. Why does it start so slow? It's not because of the network connection (well usually its not, in your case it I understand it is), but rather because of rakudo's current CompUnit
implementation (specifically CompUnitRepo::Local::Installation
). panda
uses the older style CompUnitRepo::Local::File
which rakudo can load modules faster with, but this is a bug of rakudo itself (specifically the internal JSON parser). In short: currently more installed modules = slower rakudo startup. (as a side note: zef
doesn't have to be installed to work so you could create an alias to wherever you clone zef and use that to invoke zef so as not to install extra modules, but thats more of something i'd expect a tool like rakudobrew to handle).
Do not let this speed discrepency worry you though! There is work being done on the new CompUnit
setup for rakudo by lizmat and nine (the curli branch of rakudo). This new implementation (replacing both ::Installation
and ::File
) will speed things up because it will only need to read a json file when a module is used instead of the current parse one giant json file on startup (which is why currently more installed modules = slower). Those changes will also allow the Zef code base to shrink significantly, further speeding things up, as well as allowing more focus on parallelization and its general role as a recommendation manager + content retrieval.
README
Again I agree. -v
was important initially when most people were interested in the test output, but not so much now that things are stabilizing in the ecosystem and core.
from zef.
I guess we can use a web service like cpanm
for locating metadata for module X. That will fix the problem right away since the lookup will be faster with smaller JSON response parsing time. If it timeouts or fails, we should revert to the current method.
As mentioned before, my corporate network is way slower with DNS request (long story that started with a power failure problem :) ) so you can think of it as the worst case to happen. But still it happened.
I recently added rakudobrew build-zef
to improve zef
's installation procedure.
from zef.
Ah, but you misunderstand. The slow part is not parsing metadata per install, its rakudo itself loading the meta data json every time you start it (and also use at least 1 module). The filtering of the retrieved json is generally quick. This link shows the culprit: https://github.com/rakudo/rakudo/blob/nom/src/core/CompUnitRepo/Local/Installation.pm#L9 Note despite the name that it also loads modules, not just installs them (to be specific, it will load modules installed by it, while CompUnitRepo::Local::File
can install and load modules installed by it) But again I don't expect this to last much longer. The new CompUnit
work will have to be done before x-mas, and it won't take me long to adapt changes to zef.
I had an idea the other day related to this topic though. I could create a ecosystem projects list clone but host it on github. Because git
is required anyway it would then mean the http client could be removed (less modules to install = more speed), which is certainly slower than the git
command. Then to add support for module sources other than the ecosystem when they become available (like metacpan) it could bootstrap the appropriate plugin to make it work (so its only installed if its needed/wanted). The idea is to then allow it to make recommendations based on multiple sources of modules. This would match your web service idea.
We could also find a way to provide access to the project list via IP address instead of requiring a host name... maybe git
will solve this as well. As you can tell there are quite a few improvements I would like to make, i'm just waiting for the the CompUnit
changes.
Thanks for adding zef to rakudobrew
!
from zef.
I've changed the default behavior so the package list is only updated when zef update
or zef --update install X Y Z
(and automatically once during the install of zef if the zef home directory does not exist). I will work on adding a configuration file soon so the default rules can be customized.
from zef.
👍
from zef.
NOTE: I need to re-add the mentioned functionality (to only update when needed or requested) to the new version of zef
from zef.
@azawawi is this still an issue or is it something we can close?
from zef.
Closing. Thanks for the reminder 👍
from zef.
Related Issues (20)
- `zef depends` suggests using `--exclude` but then doesn't recognize the flag
- fetch 'Usage' message incorrectly suggests arguments are optional HOT 2
- Feature request: `zef config` subcommands for debugging HOT 1
- Confusing message for command 'upgrade' HOT 4
- Feature request: Have option "--serial" be the default for commands "install" and "upgrade" HOT 2
- zef install treated "v6" as a dependency HOT 1
- No such method 'remove-artifacts' for invocant of type HOT 4
- Can't `zef install` YAMLish on Windows 10 HOT 6
- Error: Type check failed in binding to parameter '$repo-id'; HOT 1
- Use of uninitialized value @short-names-to-index HOT 4
- zef installs some module resources to /tmp/.zef which are missing on reboot HOT 5
- Add `--precomp` flag to zef HOT 1
- Use of uninitialized value @short-names-to-index in Zef::Repository::Ecosystems line 250 HOT 2
- zef install fails on a fresh (?) M1 macos brew install of rakudo star HOT 7
- zef can't find any distribution that has ":ver<*>" in its name HOT 2
- Error in dependency resolution HOT 7
- Digest vs Digest::MD5 (advice please) HOT 5
- zef may fail to install IO::String HOT 1
- Zef local test (zef test . --debug) doesn't check for valid pod HOT 5
- Shared library referenced in /tmp/.zef? Potential security issue. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zef.