Skip to content

Disabling Garbage Collection #12

@mcmah309

Description

@mcmah309

Disabling garbage collection either dynamically or during compilation would open up new performance opportunities. And if rust signatures are ever emitted to call otter functions, it would make users more inclined to integrated into existing rust projects if they are concerned about gc overhead. Possible options:

  • Compilation: Useful to make binary and library functions essentially work like arenas

  • Dynamically: For heavy workloads. Objects allocated while GC is disabled are still tracked, just not collected.

fn main():
    gc_disable()
# Do some work
    gc_enable() # If never re-enabled, then essentially the whole program or library function works like an arena
  • Arenas: Support arenas directly. Any arguments to an arena function are owned by the calling function and any returned values become owned by the calling function. It would require any value returned by the arena to be clonable, since if called by a non-arena function then the value should be cloned before the arena is freed. Every non-arena to arena call creates a new arena.
arena fn main():
   # Do some work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions