Skip to content

Reduce size_of Node for better cache performance in render loop #208

Open
@orottier

Description

@orottier

std::mem::size_of::<Node>() == 160 currently. I think we gain some nice performance (better cache utilization) if we trim it down a bit.

Some suggestions:

  • Use u8 instead of usize for input/output indices
  • Use u32 for NodeIndex instead of u64
  • Store outgoing_edges on the heap
  • Pack ChannelConfig as a single Arc<(count, mode, interp)> ChannelConfig is now a single Arc instead of 3 #307
  • Use bitflags to combine the boolean fields in a single u8

On a different note, we can explore to store the Nodes as an "struct of arrays" instead of "array (hashmap in our case) of structs" https://news.ycombinator.com/item?id=17981306

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions