The following table shows the result of a small benchmark comparing several Python ORM for importing the 10000+ terms of the ICD10 medical classifications (writing), and then for traversing all terms (reading).

All ORM used SQLite3. In addition, plain SQL is also shown for comparison.

Results:

Module

Writing

Reading

Database size

Lines of code

Inheritance

SQLAlchemy 1.1.13

20.32 seconds

6.41 seconds

962 560 bytes

42 lines

simple (?)

SQLObjet 3.4.0

7.58 seconds

2.19 seconds

966 656 bytes

35 lines

simple

Peewee 2.10.1

5.37 seconds

2.08 seconds

962 560 bytes

35 lines

simple (?)

Pony 0.7.2

7.10 seconds

0.61 seconds

958 464 bytes

35 lines

multiple (partiel)

Owlready 2 0.3

1.41 seconds

0.85 seconds

4 235 264 bytes

38 lines

multiple (full)

ORMithorynque

1.65 seconds

0.49 seconds

1 269 760 bytes

31 lines

multiple (full)

SQL (non-objet)

1.12 seconds

0.19 seconds

966 656 bytes

45 lines

none

(for numbers, the lower is always the better)

ORMithorynque beats all other ORM for speed. It also require fewer lines of code (mostly thanks to the automatic schema creation and update).

ORMithorynque databases are slighly bigger than with other ORM however; this result was expected because ORMithorynque requires an extra table for storing classname, due to multiple inheritance support.