-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize the cache mechanism #23
Comments
I'm not sure this is relevant. At the point of installing a tool we already have created a switch (requires internet) and the step just after is to install the dependencies of the project (requires internet). For 1.:
On my machine, Merlin is 12Mb, Odoc is 16Mb and OCamlformat is 24Mb. Let's say we want to build Merlin on 5 different versions of ocaml, on 5 different architectures, that's 300Mb for a single tool. For 2.: You talk about a remote repo but that's actually the point 3. Otherwise, point 2. is exactly #11
I guess you meant "downside" ? We'll need to differentiate several variants of the same package anyway (eg. with which version of OCaml is has been built) so it's not much more work on top of that. |
For the first alpha release, the cache is a local repo that is populated whenever a new package is built. So there is no "pre-populated" cache. The next stage, I think, would be to add an online repo containing pre-built static binary. |
I think I haven't explained very well what I meant in point 2. But unless you want me to explain it in more detail (in that case, please let me know!), I'd say let's just go for point 3, which I think we all prefer by now. |
Yes, that's point 3, right? I also think that's best (mostly because of the very good update story). |
As described in https://github.com/tarides/ocaml-platform/issues/13, our first approach to populating our cache is via a sandboxing mechanism. While that sandboxing approach has many advantages (also described on that issue), it also has at least one disadvantage: it's very slow. So, once our cache mechanism is fully implemented (i.e. at least issues https://github.com/tarides/ocaml-platform/issues/13 and https://github.com/tarides/ocaml-platform/issues/11), we'll need to implement an optimization for that.
Three possible approaches
So far we've been discussing to use pre-built binaries to optimize our caching mechanism. There are different ways how to realize a pre-built binaries optimization. Among others, the following three:
We embed the pre-built binaries into our tool and the first time
ocaml-platform
is run, it pre-populates our cache with those binaries.ocaml-platform
for a certain architecture and operating system, we embed the correspondent tool binaries only)ocaml-platform
binaryA similar approach to 1. (we pre-populate our cache first time
ocaml-platform
is run), but instead of embedding the pre-built binaries intoocaml-platform
, we keep them somewhere online on some repo or similar.ocaml-platform
binaryIn addition to our local cache, we add another cache in the following way: we have an online cache somewhere with the pre-built binaries and
ocaml-platform
first has a look at the online cache and installs all tools found there; then it has a look at the local cache and does the rest (one possible way to implement that approach would be by writing an online opam repo with the meta-information for all pre-built tools and adding that opam repo to the users opam state. that would be similar to option 1. in https://github.com/tarides/ocaml-platform/issues/11 but remote).ocaml-platform
binaryHave I missed any upsides or downsides? And/or are there more approaches anyone would like to discuss?
(btw, if anyone feels down for making a table out of this bad bullet point overview, don't hesitate! :))
The text was updated successfully, but these errors were encountered: