Skip to content

Drive by comment #3

@crusso

Description

@crusso

This code is super expensive

temp := Array.append<Nat8>(temp, [Vec.get(exVar.memory, sourceOffset + i)]);

The iterated append will be quadratic in cost and memory allocation.

At the very least, it would be better to just Array.init(length, 0) and write to the this one array before copying it out. Even better would be to optimize for the case there is no overlap...

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