On Friday, 18 September 2015 at 14:59:34 UTC, Nick Sabalausky
wrote:
On 09/18/2015 04:37 AM, BBasile wrote:
I find that the feature to get a particular property
(`--data=X`) is
very slow, is it normal ? On a decently recent machine it takes
something like 3 or 4 seconds. Maybe it downloads or check the
deps
while it's not necessary ?
It still has to do all the usual processing to read
dub.json/dub.sdl and build up all the package information for
the current package and all dependencies. Should be about the
same as plain old "dub describe".
I suppose for some information that might not be strictly
necessary, but I suspect that adjusting dub's
package-information-gathering to be more lazy might take some
major refactoring. And I'm not sure how much that would
realistically gain in typical real-world scenarios.
If you need multiple pieces of information, you can specify
`--data=X` multiple times in the same call to dub. Or a
comma-separated list: `--data=X,Y,X`. That way the up-front
processing would only be needed once, and not repeated for each
piece of data.
I see. This extra latency also exists when we build but usually
people don't notice it because they would think it's due to
compilation.
I thought I could use this feature in Coedit
(https://github.com/BBasile/Coedit/issues/10) rather than making
a custom (and possibly erroneous) interpretation of a DUB project
file but honestly with this problem I don't see how this switch
can be used.