Skip to content

Performance rules (round 1) #2

@43081j

Description

@43081j

We don't yet have any performance rules, so let's use this issue to track ideas.

We're looking for syntax replacements of {slow syntax} -> {fast syntax}.

NOTE, this isn't only about CPU perf, we should flag memory inefficient things too.

Suggestions

I'll update this list as we discuss.

  • [...iter].map(mapper) to Array.from(iter, mapper)
    • Array.from only makes one copy whereas spread and map makes an intermediate array
  • Array.from(iter) to [...iter]
  • Array#forEach to for...of

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