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

Share data memory of String terms #46

Open
3 tasks
mkaput opened this issue Oct 5, 2018 · 0 comments
Open
3 tasks

Share data memory of String terms #46

mkaput opened this issue Oct 5, 2018 · 0 comments
Labels
enhancement Engagement: Good for newcomers low priority Low priority runtime Area: Intentio Runtime

Comments

@mkaput
Copy link
Member

mkaput commented Oct 5, 2018

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.)
@mkaput mkaput added the runtime Area: Intentio Runtime label Oct 5, 2018
@mkaput mkaput changed the title Share data memory of String term Share data memory of String terms Oct 5, 2018
@mkaput mkaput added enhancement Engagement: Good for newcomers low priority Low priority labels Oct 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Engagement: Good for newcomers low priority Low priority runtime Area: Intentio Runtime
Projects
None yet
Development

No branches or pull requests

1 participant