Database Performance - gaddlord/mtg.studio GitHub Wiki

This documents the alternative drivers used in MTG Studio for database acceess.

The tests are executed on

Machine: Asus ROG Flow Z13 16GB ram, i5-125000H (2.5 GHz), 12 Cores, 16 Logical Processors
Card Pool size: 110'024 cards
All builds were compiled in Release mode.
All builds had debug symbols excluded.
All builds had stripped reallocation table.
Load time was computed by taking the averageg of 10 consequitive starts of the application.
Target Platform Lib Database Driver EXE Size (KB) UPX Memory (MB) Load Time (sec) Commment
Windows 32-bit VCL Mormot 3.40.0 15281 Yes 284.9 1.029 version ≤ 3.225
Windows 32-bit VCL Mormot 3.7.2 15009 (- 272) Yes 284.7 (- 0.2) 1.100 (+.071)
Windows 32-bit VCL DBExpress 3.8.10.2 15132 (- 149) Yes 285.0 (+ 0.1) 1.912 (+.883)
Windows 32-bit VCL FireDAC 3.42.0 15718 (+ 437) Yes 403.1 (+118.2) 1.728 (+.699)
Windows 32-bit VCL Mormot 3.40.0 45699 (+30418) No 240.7 (- 44.2) 1.024 (-.005) version ≥ 3.226
Windows 32-bit VCL Mormot 3.7.2 45699 (+30418) No 240.5 (- 44.4) 1.045 (+.016)
Windows 32-bit VCL DBExpress 3.8.10.2 45867 (+30586) No 240.4 (- 44.5) 1.949 (+.929)
Windows 32-bit VCL FireDAC 3.42.0 46990 (+31709) No 357.1 (+ 72.2) 1.733 (+.605)
Windows 64-bit VCL DBExpress ? 66595 (+51314) No n/a n/a runtime error
Windows 64-bit VCL FireDAC ? 68514 (+53233) No n/a n/a runtime error
Windows 32-bit FMX FireDAC 3.31.1 20287 (+ 5006) No 232.4 (- 52.5) 0.680 (-.349) loads 1000 records
Windows 64-bit FMX FireDAC 3.31.1 30592 (+15311) No 318.9 (+ 34.0) 0.560 (-.469) loads 1000 records

Observations

  • The fastest driver is Mormot 3.40.2 in VCL 32-bit without UPX compression.
  • UPX compressed executables are 3 times smaller as disk size but occupy 20% more memory.
  • FireDAC significantly increases the memory footprint.
  • DBExpress is alsmost twice slower compared to Mormot.
  • UPX compression does not affect load time.
  • Although FireDAC with FMX is faster it only loads 1000 records and slows down on scoll and grouping.
  • Using the card with WAL (Write-Ahead Logging) does not affect the loading speed.

Status Quo

Upto version 3.225 (included) we have been releasing in RELASE mode, VCL, with Mormot 3.40.0 and UPX compression.

Decission

From version 3.226 onwards we will be releasing without UPX compression for 20% smaller memory footprint and double digits load time in milliseconds.