Skip to content

Compile Time Optimization Notes

MaulingMonkey edited this page Dec 31, 2019 · 1 revision

jni-android-sys

Some timings from experiments:

  • 2s to build just the core api-level-N.rs file if all include!s are #[cfg(...)]ed out
  • 5s to compile the core api-level-N.rs file and everything it includes if the entire macro is #[cfg(...)]ed out
  • 20s to use macro_rules! to generate just class stubs, no impl bodies
  • 2m 00s to use macro_rules! to generate the universe
  • 2m 30s to use proc macros to generate the universe

File I/O overhead is low. Proc macros add 20-30s from deps. Impl bodies are the vast majority of the compile time overhead. Decl bodies are also slow enough to be annoying.

Clone this wiki locally