Repository navigation
-
benchmark/db_users: a Users API benchmark sub-project — anAPIRootwith
reflection-wired modules andRole/Address/Userentities, measured end
to end against memory, SQLite or PostgreSQL (--dockeror an existing
server), with latency percentiles and a results history (HISTORY.md). -
Performance, found and measured with
benchmark/db_users:- Entity tracking: a loaded entity's referenced entities (and lists of
them) are snapshotted by ID, not by a reflective deep copy. Change
detection already compared them by ID. SQLite: reads +22%, lists +40%,
updates +30%. - PostgreSQL: the reads of a transaction that hasn't written yet run
withoutBEGIN/COMMIT— a select of an entity with references was
BEGIN, its queries andCOMMIT. Its first write opens the transaction.
DBSQLAdapter.readsOutsideTransaction, on by default for PostgreSQL
(READ COMMITTED), opt-out withreadsOutsideTransaction: false.
Single-entity reads 2x faster. DBSQLMemoryAdapter: relationship selects and inserts go through the
relationship indexes; a delete by ID takes its row by key and resolves
only it; a relationship delete is narrowed through the index. Reads up
to 3x, writes up to 7x faster.
- Entity tracking: a loaded entity's referenced entities (and lists of
-
Fixes:
LoggerHandler.rootthrew aLateInitializationErrorwhen it was the
first logging access.DBSQLMemoryAdapter: after a rollback, a relationship restored in its
table was missing from the relationship index (an index entry is aSet
changed in place, whichMapHistorycan't roll back), so queries through
the relationship missed it. Its indexes versions snapshot was also never
refreshed.
-
Dependency updates:
reflection_factory: ^2.10.1 (faster constructor lookup when decoding
entities: +10–15% on reads)map_history: ^1.0.7 (consolidatevisits only the changed keys: the
memory adapter's commits no longer scale with the table size)