Skip to content

Fast JavaScript / C++ version #11

@jjrv

Description

@jjrv

This branchless version in JavaScript:
https://gist.github.com/jjrv/b99d3c79eea6e7cc51bb148f309135db

maps the first 256 points along the curve to x, y coordinates and back on my 2.2 GHz CPU in about 1.8 ms.

I've tested it for all about 4 billion 32-bit indices. The test took 120 seconds on a single thread.

Here's a slightly different branchless version in C++:
https://github.com/rawrunprotected/hilbert_curves

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions