Why OpenSSL? OpenSSL is the reference library for cryptography and secure TLS/HTTPS communication. It is part of most Linux/BSD systems, and covers a lot of use cases and algorithms. Even if it had some vulnerabilities in the past, it has been audited and validated for business use. Some algorithms […]
Last week, I committed new ASM implementations of our AES-PRNG, AES-CTR and AES-GCM for mORMot 2.
They handle eight 128-bit at once in an interleaved fashion, as permitted by the CTR chaining mode. The aes-ni opcodes (
aesenc aesenclast) are used for AES process, and the GMAC of the AES-GCM mode is computed using the
Resulting performance is amazing: on my simple Core i3, I reach 2.6 GB/s for
aes-128-ctr, and 1.5 GB/s for
aes-128-gcm for instance - the first being actually faster than OpenSSL!
I have just committed some new AesNiHash32 AesNiHash64 AesNiHash128 Hashers for mORMot 2. They are using AES-NI and SSE4.1 opcodes on x86_64 and i386. This implementation is faster than the fastest SSE4.1 crc32c and with a much higher usability (less collisions). Logic was extracted from the Go […]
One proposal for mORMot 2. What if we renamed the RawUTF8 type into Utf8? With a default compatibility redirection if PUREMORMOT2 is not defined, of course. The "Raw" prefix came from early mORMot code, which used TRichView as reference for the UTF-8 encoding... but it is clearly an […]
After a lot of work, our mORMot 2 fork is entering its testing phase.
/src/core /src/lib /src/net /src/db /src/orm /src/soa /src/app folders of our Source Code repository have been implemented.
Please check https://github.com/synopse/mORMot2 for the latest version of the source code. The
README.md files on each folder would help you discover the new framework design, and the content of each unit.
EKON 24 just finished. "The conference for Delphi & more" was fully online this year, due to the viral context... But this was a great event, and I am very happy to have been part of it. Please find the slides on my two sessions: mORMot 2 Performance: from Delphi to AVX2 Of course, […]
Last weeks, we introduced REST, ORM and SOA process in the mORMot2 repository.
During this phase, we split the huge
mORMot.pas unit into several
mormot.soa.*.pas units, to follow SOLID principles.
But we also renamed the base types into something more consistent and easier to work with.
For several reasons, only plain ASCII characters are accepted in Web URIs. Other characters should be escaped with % and the hexadecimal value of its code.
The tilde character
~ is not needed to be escaped... at least in theory... because in practice most code expects it...
A journey into confusing RFCs...
A regression in the Delphi 10.4 compiler was identified. Its optimizer wrongly deletes some code, in one very specific part of the framework.
As a result a GPF (Access violation) may be triggered with Delphi 10.4 in release mode - the debug mode (when optimization is disabled) has no problem. Thanks to great user feedback, we were able to circumvent it. But we should better stay in alert, like any mORMot, until Delphi 10.4 officially release a patch.
About latest SQlite3 3.32.xxx there is a big problem with codecs.
Critical changes to the public SQLite code were introduced on Feb 7, 2020: “Simplify the code by removing the unsupported and undocumented SQLITE_HAS_CODEC compile-time option”. With the release of SQLite version 3.32.0 on May 22, 2020 these changes finally took officially effect, although they weren't officially announced.
As a sad and unexpected consequence, we are NOT ANY MORE able to compile the new SQlite3 amalgamation with our encryption patch.
As a gift to the FPC community, I just committed a new Memory Manager for FPC.
Check mormot.core.fpcx64mm.pas in our mORMot2 repository.
This is a stand-alone unit for FPC only.
It targets Windows and Linux multi-threaded Service applications - typically mORMot daemons.
It is written in almost pure x86_64 assembly, and some unique tricks in the Delphi/FPC Memory Manager world.
It is based on FastMM4 (not FastMM5), and we didn't follow the path of the FastMM4-AVX version - instead of AVX, we use plain good (non-temporal) SSE2 opcode, and we rely on the mremap API on Linux for very efficient reallocation. Using mremap is perhaps the biggest benefit of this memory manager - it leverages a killer feature of the Linux kernel for sure. By the way, we directly call the Kernel without the need of the libc.
We tuned our x86_64 assembly a lot, and made it cross-platform (Windows and POSIX). We profiled the multi-threading, especially by adding some additional small blocks for GetMem (which is a less expensive notion of "arenas" as used in FastMM5 and most C allocators), introducing an innovatice and very efficient round-robin of tiny blocks (<128 bytes), and proper spinning for FreeMem and medium blocks.
It runs all our regression tests with huge performance and stability - including multi-threaded tests with almost no slow down: sleep is reported as less than 1 ms during a 1 minute test. It has also been validated on some demanding multi-threaded tasks.
Thanks you all for have posted your feedback on our mORMot2 Survey!
Here are some insights.
On server side, a lot of CPU is done processing conversions to or from text. Mainly JSON these days.
In mORMot, we take care a lot about performance, so we have
rewritten most conversion functions to have something faster than the Delphi or
FPC RTL can offer.
Only float to text conversion was not available. And RTL str/floattexttext performance, at least under Delphi, is not consistent among platforms.
So we just added a new Double-To-Text set of functions.
First of all, if it was not clear enough: Delphi will continue to be supported in mORMot 2.0. Some people reported that our previous article may have been misleading. But perhaps not all versions. For sure, Delphi 5 and Kylix will not be supported in mORMot 2. It is also possible that it would not […]
The more I think of it, the more I am convinced it is time to change how the
framework is versioned.
We have version 1.18 since years... difficult to follow... time to upgrade!
I would like to upgrade mORMot to version 2 - with a major refactoring.
Our Open Source framework includes some optimized asm alternatives
We just rewrote from scratch the x86_64 version of those,
which was previously taken from third-party snippets.
The brand new code is meant to be more efficient and maintainable. In particular, we switched to SIMD 128-bit SSE2 or 256bit AVX memory access (if available), whereas current version was using 64-bit regular registers. The small blocks (i.e. < 32 bytes) process occurs very often, e.g. when processing strings, so has been tuned a lot. Non temporal instructions (i.e. bypassing the CPU cache) are used for biggest chunks of data. We tested ERMS support, but it was found of no benefit in respect to our optimized SIMD, and was actually slower than our non-temporal variants. So ERMS code is currently disabled in the source, and may be enabled on demand by a conditional.
move() was not bad. Delphi's Win64 was far
from optimized - even ERMS was poorly introduced in latest RTL, since it should
be triggered only for blocks > 2KB. Sadly, Delphi doesn't support AVX
assembly yet, so those opcodes would be available only on FPC.
Resulting numbers are talking by themselves. Working on Win64 and Linux, of course.
I just finished my workshop at EKON 23.
Like every year, it was a great event to attempt to, and I enjoyed presenting 2 sessions and 1 workshop.
Sessions were about "Kingdom Driven Design" (KDD), which is the
name I used to define a cut-down version of "Domain Driven Design" (DDD).
Less paranoid, a bit less isolation, but perhaps more common sense for the less sensitive projects.
Some presentations and code are now available!
I just found some very nice articles by Stephan Bester about first steps to mORMot's ORM and SOA.
Don't be scared by the mORMot: it is more stressed than you
This painful picture just won a wildlife photographer prize... poor little rodent!
A long-awaited feature was the ability to create stand-alone mORMot Win64 applications via Delphi, with no external sqlite3-64.dll required.
It is now available, with proper integration, and encryption is working!
There are still some days to join EKON 23 conferences with the reduced price!
I will make 2 sessions, and 1 workshop, in English (my German is not good
enough), about practical project design and mORMot.
If you find DDD is a bit too much for you, but still want to write clean code, check this!
« previous entries - page 1 of 11