Skip to content

Memory duplication when using slice #1650

@cdlscpmv

Description

@cdlscpmv

I've noticed that calling slice on an array or tuple causes new memory to be allocated for the returned tuple. This may cause some performance penalty when working with big data sets.

Since the returned tuple is read-only, is it possible to reuse the existing memory for it instead of making a copy, or this would require some big changes in the Janet VM?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions