Ideas for reduced compile times #897
Replies: 3 comments 7 replies
-
These are good ideas and I appreciate that you care. Here are some of my initial arguments, which may be wrong, outdated, biased, and therefore - of course - open for a more detailed discussion:
|
Beta Was this translation helpful? Give feedback.
-
Okay. So, i am sort of wrong. while removing Here's the cargo timing html files cargo_timings.zip if you want to check them yourself. The pipeline is basically bottlenecked by
When i disabled prettyplease feature of There are some other crates like regex or flate2 which can be removed too to reduce deps count. But there is just no way to bring the compile times below 15-ish seconds when we generate bindings on every single clean build. I will let you decide how to proceed further. If you do decide to go with the manual bindings (either skiasharp or otherwise), i can help do the manual monkey work like changing the existing safe wrappers with new bindings etc.. |
Beta Was this translation helpful? Give feedback.
-
I am working on ckia based on skiasharp's c bindings. It seems like skia with fast compile times is doable (with zero build dependencies). I thought i will mention it here, in case you can see any obvious mistakes that i am making.
The result is a crate that builds within 4 seconds. we are bottlenecked on curl's network speed. Once we start caching the downloaded artifacts in a global place, it should probably be <1sec for building as we just print the link args and nothing else. TBH, i kinda regret doing this. Getting skia to build was not easy, and my lack of c++ knowledge didn't help. If i would have spent this time contributing to a rust project like femtovg, it would have been atleast fun learning all kinds of vector graphics knowledge. Instead, i spent my time learning weird build system (which was going to be deprecated with bazel anyway) and c++. But, i do love the compile times, being able to dynamically link skia -> skip building it, add skia bindings to wasm plugins etc.. Anyway, i will spend tonight finishing up the build.rs work by copying as much of rust-skia as possible. Just wanted to ask if you there's any specific platforms/weirdness i need to be worried about. or if this path will lead me to some kind of bad ending. PS:
|
Beta Was this translation helpful? Give feedback.
-
Replace
ureq
withcurl
rusty_v8
is a project maintained by deno people similar to rust-skia.C
bindingsgn
/ninja
from chromium/google familyThey do try to use python first, but when it fails, rusty_v8 simply use a curl command in their build script to download their static binary. I think skia-safe could remove a build dependency by doing so which should improve compile times.
generate bindings once per release
rusty_v8 actually maintain a single
bindings.cc
file with custom bindings. And the rest of the safe wrapping just use these c functions.skia-safe
can do this too, by only generating bindings before publishing a release, and only committing the generatedbindings.rs
file in the sources. or even maintain manual bindings.bindings
crate as build dependency.Ofcourse, we could actually go a step further and use skiasharp's C bindings which are maintained by hand.
Beta Was this translation helpful? Give feedback.
All reactions