* * *

Author Topic: The Alioth Benchmark Game  (Read 367 times)


  • Sr. Member
  • ****
  • Posts: 271
The Alioth Benchmark Game
« on: February 02, 2018, 06:25:33 pm »
In the alioth "benchmark game" https://benchmarksgame.alioth.debian.org/ , the performance of FPC for the "binary tree" test is very poor: FPC 36.4 secs vs. C++ 2.55 secs. The test is all about allocating and deallocating atomic chunks of memory, and the code provided does this rather inefficiently by calls to GetMem()/FreeMem().

I now added memory pooling, using unit pooledmm, which decreased runtime by approximately factor 5. Then added threading support (unit mtpocs), but the performance went down dramatically. Obviously the standard memory manager performs rather poorly for this test case. But when using cmem, the code runs approximately 8-10 x faster than the original. This is all under windows.

Can someone please test this with Lazarus 64bit under linux, preferrably on a quad core machine ? With argument 21, the runtime should be below 5 seconds.

Note: Run the exe from a shell, because performance is VERY poor when running inside the Lazarus IDE (at least unter windows).


  • Hero Member
  • *****
  • Posts: 7803
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: The Alioth Benchmark Game
« Reply #1 on: February 03, 2018, 04:10:04 am »
Using the following options:

The original code runs in:
real   0m17,918s
user   0m17,402s
sys   0m0,517s

while your mod runs in:
real   0m2,527s
user   0m8,277s
sys   0m0,070s

so roughly 7 times faster, with around 100 ms variance.
« Last Edit: February 03, 2018, 04:12:37 am by Leledumbo »


  • Sr. Member
  • ****
  • Posts: 271
Re: The Alioth Benchmark Game
« Reply #2 on: February 03, 2018, 09:48:49 am »
Thanks Leledumbo. I will submit this code then.



Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus