Skip to content

Optimization suggestion for _lookAreaMixedRegister() #41

Open
@KageJittai

Description

@KageJittai

In _lookAreaMixedRegister at src/game/rooms.js#L681 the engine is using a .forEach call on the keys of an object.

You should be able to optimize this code quite a bit by converting it to a for loop. It is known that Array.forEach, especially when using closure, has far worst performance (between 50% - 90%) then a standard for loop.

https://jsperf.com/fast-array-foreach

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