We have just released a set of slides introducing ORM, SOA, REST, JSON, MVC, MVVM, SOLID, Mocks/Stubs, Domain-Driven Design concepts with Delphi, and showing some sample code using our Open Source mORMot framework. You can follow the public link on Google Drive! This is a great opportunity to […]
We just tested, benchmarked and validated Oracle MySQL, IBM DB2 and PostgreSQL support for our
database classes and the mORMot's ORM core.
This article will also show all updated results, including our newly introduced multi-value INSERT statement generations, which speed up a lot BATCH insertion.
Purpose here is not to say that one library or database is better or faster than another, but publish a snapshot of mORMot persistence layer abilities, depending on each access library.
In this timing, we do not benchmark only the "pure" SQL/DB layer access
SynDB units), but the whole Client-Server ORM of our
Process below includes all aspects of our ORM:
- Access via high level CRUD methods (Add/Update/Delete/Retrieve, either per-object or in BATCH mode);
- Read and write access of
TSQLRecordinstances, via optimized RTTI;
- JSON marshaling of all values (ready to be transmitted over a network);
- REST routing, with security, logging and statistic;
- Virtual cross-database layer using its SQLite3 kernel;
- SQL on-the-fly generation and translation (in virtual mode);
- Access to the database engines via several libraries or providers.
In those tests, we just bypassed the communication layer, since
TSQLRestServer are run in-process,
in the same thread - as a
TSQLRestServerDB instance. So you have
here some raw performance testimony of our framework's ORM and RESTful core,
and may expect good scaling abilities when running on high-end hardware, over a
On a recent notebook computer (Core i7 and SSD drive), depending on the back-end database interfaced, mORMot excels in speed, as will show the following benchmark:
- You can persist up to 570,000 objects per second, or retrieve 870,000 objects per second (for our pure Delphi in-memory engine);
- When data is retrieved from server or client 38, you can read more than 900,000 objects per second, whatever the database back-end is;
- With a high-performance database like Oracle, and our direct access classes, you can write 70,000 (via array binding) and read 160,000 objects per second, over a 100 MB network;
- When using alternate database access libraries (e.g. Zeos, or
DB.pasbased classes), speed is lower (even if comparable for DB2, MS SQL, PostgreSQL, MySQL) but still enough for most work, due to some optimizations in the mORMot code (e.g. caching of prepared statements, SQL multi-values insertion, direct export to/from JSON, SQlite3 virtual mode design, avoid most temporary memory allocation...).
Difficult to find a faster ORM, I suspect.