Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

Consider iterating over the string in forward direction #12

@victor-homyakov

Description

@victor-homyakov

Differences include iterating over the string backwards (as that is faster in JavaScript)

This requires some proof, because for long strings backward iteration may break any data caching/prefetching, therefore access to string characters may be significantly slower.

https://jsperf.com/string-hash-speed forward direction is faster in Chrome

https://gist.github.com/victor-homyakov/bcb7d7911e4a388b1c810f8c3ce17bcf shows me that in Node 8.6.0 forward iteration is twice as fast.

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