Firebird 4 versus Firebird 3 single thread performance comparison
Fikret Hasovic, October 2021
The long-awaited Firebird 4 engine was released June 1st, 2021. Firebird 4 does include several additional features like larger page size and synchronous/asynchronous database replication. With additional features added to the database engine, we would like to find out how the performance could be impacted.
Most IBExpert customers are familiar with the IBExpert Database Benchmark tool that comes with the IBExpert Developer Studio full version or the free Benchmark Tool which can be downloaded here: here. The benchmark tool does simulate a real database multi thread environment. In this white paper, we would like to leave out the multi-thread environment and focus just on the performance stats on a single thread environment.
We are comparing Firebird 4 versus our good old and reliable Firebird 3. The testing environment is our standard IFSML servers (0.5 TB B SSD Linux Ubuntu OS), and we are using the demo database that is delivered together with the IBExpert Developer Studio full version. In the comparison we are using the default Firebird configuration. Other than that, we are trying to measure the performance impact by turning on the built-in Firebird 4 replication. The Firebird 3 database was created with a 16K page size, and compared to the Firebird 4 database with the same page size of 16K and with the new 32K page size.
Tests were carried out on each version; first we generated the sample data and performed some insert/update and delete operations on the database, after the first run the second run was initiated with deleting existing data prior to generating the same data again, all as part of a standard procedure.
We have found some interesting results, and since Firebird 3 doesn’t support a page size larger than 16K, the results are using Firebird 4 with 16K and 32K page sizes.
Please note that this performance benchmark covers a single thread comparison on a Firebird Server running Linux, as mentioned above, and the scripts were initiated from a Windows machine.
The following chart displays the performance hit by using the Firebird 4 built-in replication:
Test script
You can test our comparison approach on your own hardware by using our demo database and the scripts that we deliver together with the full IBExpert Developer Studio customer version in folder C:\Program Files (x86)\HK-Software\IBExpertDemoDB. If you are using a different IBExpert version, you can mail us at register@ibexpert.com to request a copy of the demo database scripts. You can also use and test with your own custom-tuned Firebird engine.
execute IBEBlock as begin FBSrc = ibec_CreateConnection(__ctFirebird,'DBName="127.0.0.1:c:\db\db1.fdb"; ClientLib=fbclient.dll; user=SYSDBA; password=masterkey; names=NONE; sqldialect=3'); ibec_UseConnection(FBSrc); Time1 = ibec_GetTickCount(); execute procedure INITALL(10000); commit; for i = 0 to 99 do begin ibec_Progress(i); execute procedure CREATE_MORE_ORDERS; commit; end; Time2 = ibec_GetTickCount(); cout = 'Time elapsed: ' || ((Time2 - Time1) / 1000) || ' seconds'; ibec_ShowMessage(cout); ibec_CloseConnection(FBSrc); end
Conclusion
Our tests show that additional features added to Firebird 4 do reduce the performance compared to Firebird 3. When using a page size of 16K for both databases engines, we found barely any performance differences, but Firebird 4 is slower in our tests. Enabling or disabling the Forced Writes option made no apparent difference to the performance. However, activating the built‐in replication engine results in some performance hit, as shown in our graphs.
Using the 32K page size on a Firebird 4 database results in a noticeable performance decrease and replication does add additional performance degradation.
As a direct replacement for Firebird 3, Firebird 4 will probably show similar performance. There are, however, some very neat features included in Firebird 4 that could overrule if you can accept the slight performance impact.
In percentages, our test shows that Firebird 3 is faster than Firebird 4 with a 16K page size: 1.9% in the first run, and 1.5% in the second run (as explained above). When we talk about a maximum page size of 32K in Firebird 4, then Firebird 3 (16K page size) is 17.3% faster than Firebird 4 (32K page size) in the first run, and 14.3% in the second run; or if we look at it from different point of view, Firebird 4 (32K page size) is 14.8% slower than Firebird 3 (16K page size) in the first run and 12.5% in the second run.
If you would like to find out more about our high‐performance dedicated Firebird servers, please contact ifs@ibexpert.biz.