Skip to content

speeding up clorm #101

@florianfischer91

Description

@florianfischer91

I would like to ask if clorm could be shipped with the possibility to compile it down to c/c++ (using cython)? I saw that pydantic also provide this feature and they are talking about a performance improvement of about 30-50%.
I played around a bit and with small changes in the source code (still valid python) i was able to compile it with cython. Running some benchmarks (with files in profiling-dir) looks quite nice especially when looping comes into play, f.i. creating and adding 500k facts to a factbase is about 38% faster or querying a factbase to find one element is about 32% faster.
For the full cython vs non-cython benchmark compare these two files
noncython.md
cython.md

If you like it just let me know and i'm keen to create a PR.

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