Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.
This repository was archived by the owner on Jan 21, 2022. It is now read-only.

Share data memory of String terms #46

@mkaput

Description

@mkaput

Currently, String terms own their data. Some read-only operations such as slicing make unnecessary copies of data.

This can be optimised by storing data in a separate entity, called Buffer, where Strings themselves only store the pointer to the Buffer and offsets in its data. Buffers could be allocated with a custom allocator for faster allocations, and to introduce some interning for memory usage reduction.

Strings could be further optimised by introducing Copy-on-Write semantics, but this requires investigation whether this would provide any performance gains.

Tasks (each should be a separate PR):

  • Introduce the concept of Buffers and optimise slices
  • Implement custom memory area for Buffers and intern small buffers
  • Investigate Copy-on-Write semantics for Buffers, and implement it would provide decent improvements. Optimize string "mutation" (replacing sub-ranges etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEngagement: Good for newcomerslow priorityLow priorityruntimeArea: Intentio Runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions