We have included x64 optimized asm of FillChar() and Move() for Win64 - for corresponding compiler targets, i.e. Delphi XE2 and XE3. It will handle properly cache prefetch and appropriate SSE2 move instructions. The System.pas unit of Delphi RTL will be patched at startup, unless the NOX64PATCHRTL […]
2013-03-07
64 bit compatibility of mORMot units
2013-03-07. Open Source › mORMot Framework
I'm happy to announce that mORMot units are now compiling and working great in 64
bit mode, under Windows.
Need a Delphi XE2/XE3 compiler, of course!
ORM and services are now available in Win64, on both client and
server sides.
Low-level x64 assembler stubs have been created, tested and
optimized.
UI part is also available... that is grid display, reporting (with pdf
export and display anti-aliasing), ribbon auto-generation,
SynTaskDialog, i18n... the main SynFile demo just works
great!
Overall impression is very positive, and speed is comparable to 32 bit version (only 10-15% slower).
Speed decrease seems to be mostly due to doubled pointer size, and some less
optimized part of the official Delphi RTL.
But since mORMot core uses its own set of functions (e.g. for
JSON serialization, RTTI support or interface calls or stubbing), we were able
to release the whole 64 bit power of your hardware.
Delphi 64 bit compiler sounds stable and efficient. Even when working at low
level, with assembler stubs.
Generated code sounds more optimized than the one emitted by
FreePascalCompiler - and RTL is very close to 32 bit mode.
Overall, VCL conversion worked as easily than a simple re-build.
Embarcadero's people did a great job for VCL Win64 support, here!
2013-02-25
Using external MinGW/VisualC++ sqlite3.dll - including benchmark
2013-02-25. Open Source › mORMot Framework
With upcoming revision 1.18 of the framework, our
SynSQlite3.pas unit is able to access the SQLite3 engine
in two ways:
- Either statically linked within the project executable;
- Or from an external
sqlite3.dlllibrary file.

The SQLite3 APIs and constants are defined in
SynSQlite3.pas, and accessible via a TSQLite3Library
class definition. It defines a global sqlite3 variable as
such:
var sqlite3: TSQLite3Library;
To use the SQLite3 engine, an instance of
TSQLite3Library class shall be assigned to this global variable.
Then all mORMot's calls will be made through it, calling e.g.
sqlite3.open() instead of sqlite3_open().
There are two implementation classes:
| Class | Unit | Purpose |
TSQLite3LibraryStatic |
SynSQLite3Static.pas |
Statically linked engine (.obj within the
.exe) |
TSQLite3LibraryDynamic |
SynSQLite3.pas |
Instantiate an external sqlite3.dll instance |
Referring to SynSQLite3Static.pas in the uses
clause of your project is enough to link the .obj engine into your
executable.
Warning - breaking change: before version 1.18 of the framework,
link of static .obj was forced - so you must add a reference to
SynSQLite3Static in your project uses clause to work
as expected.
In order to use an external sqlite3.dll library, you have to
set the global sqlite3 variable as such:
FreeAndNil(sqlite3); // release any previous instance (e.g. static)
sqlite3 := TSQLite3LibraryDynamic.Create;
Of course, FreeAndNil(sqlite3) is not mandatory, and should be
necessary only to avoid any memory leak if another SQLite3 engine
instance was allocated (may be the case if SynSQLite3Static is
referred somewhere in your project's units).
Here are some benchmarks, compiled with Delphi XE3, run in a 32 bit
project, using either the static bcc-compiled engine, or an external
sqlite3.dll, compiled via
MinGW or Microsoft Visual C++.
2013-02-17
Interface-based service sample: remote SQL access
2013-02-17. Open Source › mORMot Framework
You will find in the SQLite3\Sample\16 - Execute SQL via
services folder of mORMot source code a Client-Server sample
able to access any external database via JSON and HTTP.
It is a good demonstration of how to use an interface-based service between
a client and a server.
It will also show how our SynDB classes have a quite abstract
design, and are easy to work with, whatever database provider you need to
use.

The corresponding service contract has been defined:
TRemoteSQLEngine = (rseOleDB, rseODBC, rseOracle, rseSQlite3, rseJet, rseMSSQL);
IRemoteSQL = interface(IInvokable) ['{9A60C8ED-CEB2-4E09-87D4-4A16F496E5FE}'] procedure Connect(aEngine: TRemoteSQLEngine; const aServerName, aDatabaseName, aUserID, aPassWord: RawUTF8); function GetTableNames: TRawUTF8DynArray; function Execute(const aSQL: RawUTF8; aExpectResults, aExpanded: Boolean): RawJSON; end;
Purpose of this service is:
- To Connect() to external databases, given the parameters of a
standard TSQLDBConnectionProperties. Create() constructor;
- Retrieve all table names of this external database as a list;
- Execute any SQL statement, returning the content as JSON array, ready to be
consumed by AJAX applications (if aExpanded is true),
or a Delphi client (e.g. via a TSQLTableJSON and the
mORMotUI unit).
Of course, this service will be define as sicClientDriven mode,
that is, the framework will be able to manage a client-driven
TSQLDBProperties instance life time.
Benefit of this service is that no database connection is required on the
client side: a regular HTTP connection is enough.
No need to install nor configure any database provider, and full SQL access to
the remote databases.
Due to our optimized JSON serialization, it will probably be faster to work with such plain HTTP / JSON services, instead of a database connection through a VPN. In fact, database connections are made to work on a local network, and do not like high-latency connections, which are typical on the Internet.
2013-02-12
Introducing ZEOS, UniDAC, NexusDB, BDE, any TDataset to SynDB and mORMot's ORM
2013-02-12. Open Source › mORMot Framework
Up to now, our SynDB database classes were handling
ODBC, OleDB providers and direct Oracle or
SQLite3 connection.
We have added a DB.pas based layer, ready to be used with
UniDAC, NexusDB, or the BDE.
Any other TDataset based component is ready to be interfaced,
including UIB, AnyDAC or DBExpress.

The ZEOS library (in its latest 7.0.3
stable version, which works from Delphi 7 up to XE3) has also been
interfaced, but without the TDataset/DB.pas layer:
our SynDBZEOS.pas unit calls the ZDBC layer, which is not
tied to DB.pas nor its RAD components, and is therefore
faster. By the way, it will work also with the Starter edition of
Delphi (which does not include the DB components) - just like the other
"regular" SynDB classes.

This is a work in progress, any testing and feedback is welcome!
We had to circumvent some particularities of the libraries, but I guess we have
something interesting.
A dedicated "SynDBDataset" sub-folder has been created in the repository, to contain all
SynDBDataset.pas-based database providers.
SynDBNexusDB.pas unit has been moved within this sub-folder,
as SynDBUniDAC.pas + SynDBBDE.pas units have
been added.
SynDBZeos.pas has a direct access to the ZDBC layer, so
is not part of the "SynDBDataset" sub-folder.
Here is some benchmark, mainly about Oracle and
SQlite3 database access.
Of course, our direct SynDBOracle / SynDBSQLite3
layers are the fastest around, and we can see that ZDBC layer is sometimes more
efficient than the TDataset components.
2013-02-03
Log to the console
2013-02-03. Open Source › mORMot Framework
Our framework features an integrated logging class, ready to be enabled for support and statistics.
For debugging purposes, it could be very handy to output the logging content
to a console window.
It enables interactive debugging of a Client-Server process, for instance: you
can interact with the Client, then look in real time at the server console
window, and inspect which requests are processed, without the need to open the
log file.

Depending on the events, colors will be used to write the corresponding information. Errors will be displayed as light red, for instance.
2013-01-28
External database speed improvements
2013-01-28. Open Source › mORMot Framework
Some major speed improvements have been made to our SynDB*
units, and how they are used within the mORMot persistence
layer.
It results in an amazing speed increase, in some cases.
Here are some of the optimizations how took place in the source code trunk:
- SQL statement client-side cache in ODBC and OleDB;
- SQL statement server-side cache for Oracle;
- When inserting individual data rows in an external table, the last inserted
IDs are maintained in memory instead of executing "select max(id)" -
we added a new property
EngineAddUseSelectMaxIDto unset this optimization - we noted that this modification circumvented a known limitation of Firebird very efficiently.
Overall, I observed from x2 to x10 performance boost with simple
Add() operations, using ODBC, OleDB and direct Oracle access, when
compare to previous
benchmarks (which were already impressive).
BATCH
mode performance is less impacted, since it by-passed some of those
limitations, but even in this operation mode, there is some benefits
(especially with ODBC and OleDB).
Here are some results, directly generated by the supplied "15 - External DB performance" sample.
2013-01-27
Video about mORMot authentication
2013-01-27. Open Source › mORMot Framework
A new mORMot user notified on our forum that he just made a short video, about authentication and security with our framework, from the perspective of an AJAX Client. Many thanks for sharing your experiences! This video illustrate how RESTful authentication is implemented by mORMot. It compares also […]
« previous entries - page 28 of 52 - next entries »
