Skip to content

Persisted Assembly Design #110

@ackava

Description

@ackava
  1. KeyStrings class is an expensive class, instead KeyStrings should be part of JSContext as a field and must be shared as unique instance.
  2. Avoid Pre Initialized Static fields as every access is a conditional access.
  3. A new Script Instance must be derived from JSFunction with InvokeFunction overriden. And every keystring should be a field inside derived class. This is to avoid static access.
  4. Saved assembly with classes provide better closure access instead of dynamic collection growing collection. Compiled classes offer better loading at runtime compared to dynamic methods. Every call to JSFunction is two indirection due to inherited InvokeFunction as well as calling delegate which again does null check, method pointer fetch and jumping to instruction.
  5. We are not going to use C# code generation as it skips tail call optimization.
  6. .NET 9 offers Portable Debug documents in the assembly that can remove need for extra IL to track stack traces.

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