Skip to content

Compile time optimization #84

@AzurIce

Description

@AzurIce

Some strategies from bevy (https://bevy.org/learn/quick-start/getting-started/setup/#enable-fast-compiles-optional):

  • Use dynamic linking for ranim crate, like what bevy does
    Now this is achived by adding crate-type = ["rlib", "dylib"] for ranim package's lib, then use RUSTFLAGS="-C prefer-dynamic"(this requires no ranim_internal crate, however it affects all crates)
  • Use faster linker like lld and mold
  • Use nightly toolchain
  • Use cranelift for codegen (but still unstable)

And at the same time, we can re-arrange our packages.

In user's code, we only rely on Scene's API, Items and Animations:

  • Scene's API can be a simple trait.
  • Items are simple data structures that implements Extract to Basic Item (like VItemPrimitive).
  • Animations are also simple data structures that implements EvalDynamic.

So, the packages can be re-arrange into:

  • ranim-core: provides Scene, Extract traits and Basic Items.
  • ranim-render: provides implementation of render for Basic Items.
  • ranim-cli or ranim-app or ...: use all above to provide render api, preview app, etc.
  • ranim-items: ranim builtin items built on top of Basic Items
  • ranim-anims: ranim builtin anims
  • ...

And in user's code, we actually just need ranim-core.

But it will requires redesign and rewrite of the internal of timeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions