Skip to content

[pxd] Some easy performance wins and fixups. #124

@will-ca

Description

@will-ca

I very quickly tested most of these back in December, but got sidetracked before doing it properly for a PR and have had them on my list to go back to ever since.

It's time for me to admit that I have no idea when or if I'm going to get around to that, so here's the notes. Maybe posting this issue will jolt me to go back to this, but who knows 🤷.

Don't install MyPy for Cython.

MyPy's not needed for the Cython version.

Previously I removed it from shell.nix as a last-minute change, but forgot to remove it from py_env.sh.

Disable profiling. (~+10%?)
Disable bounds checking.
Remove cpdef and cdef public. (~+15%?)

You may need to do a git clean -Xi to generate new C sources.

Add notes, but don't implement:

Switch RAM.data to pointer? (~+10%?)
int addr in RAM.get (~+10%?)

(IIRC I wasn't sure about implementing the last two because they change the code semantics and thus could be considered unfair/not a 1:1 equivalence to the other implementations.)

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