[fpc-pascal] FPC Graphics options?
Graeme Geldenhuys
mailinglists at geldenhuys.co.uk
Fri May 12 10:01:37 CEST 2017
On 2017-05-12 08:30, Marco van de Voort wrote:
> (Quite confusing paragraph mixing up graphics (which is typically bound in
> speed by the drawing API that you use) and generated code speed, what did
> you actually mean?)
I was discussed heavily in the Lazarus Forum. The test was a 3D software
raycaster (think Doom or Wolfenstein games, but with 3d camera angles).
Virtually identical code between Object Pascal, C and Java was written,
using the exact same window size and rendering world. The Object Pascal
code compiled with FPC managed to get a dismal 8 FPS maximum. The C and
Java code managed to run between 35-45 FPS.
When the application runs, most of the time spent is finding
intersection points in the raycasting engine and rendering each frame to
the image buffer. In overall comparison, very little time is spent
bit-blitting the image buffer to the screen.
I felt the test was a good one, as 90-95% is spent in the ray-casting
engine, not the graphics API. Also, as the different language
implementations were near identical, it was a good compiler comparison -
to see how good they can optimise near identical written code.
The results shouldn't have come as too much of a surprise though. It was
often said, in this mailing list, that FPC's goal is maintainability and
multiple platform support. Good optimised binaries is a distant third.
The same comparison has been made numerous times between Delphi and FPC,
and the same answer was always given. FPC supports multiple CPU's and
OSes, and at the time Delphi only supported x86, so Borland could do
more optimisations.
Anyway, I don't want to hijack this thread with this discussion, rather
see the discussion in the Lazarus Forum - Graphics section. The test
code was posted there too.
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the fpc-pascal
mailing list