[fpc-pascal] FPC Graphics options?

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri May 12 12:11:22 CEST 2017


On 2017-05-12 00:57, Jon Foster wrote:
> One of the last set of benchmarks I did that

Please note, I did not set out to implement a benchmark. I think all 
purpose written benchmarks are bias and unrealistic. I implemented a 
legit software raycaster for a game I was developing. Initially I was 
going to implement it in Java, but then thought I would rather like to 
use my much loved Object Pascal language. That plan failed in the end.


> Two things surprised me when I ran this: the Java speed and the speed of
> the initial JavaScript run. I used SpiderMonkey (Mozilla) for the JS test
> and OpenJDK 6 for Java.

I was developing with Java 8 (OpenJDK). And yes, Java speed is 
phenomenal these days. A far cry from the performance seen in the late 90's.


> In short if your suffering a performance issue I'd look to the libraries in
> use for poor implementations. Like anything else, bad software can be
> written with FPC too.

Both the Java and Object Pascal code was poorly written - because they 
were very closely based on a JavaScript implementation which was meant 
for a 4KBytes competition (see how much your can do in just 4KB).

Still, the Java compiler did a better job in optimising the final binary 
code. The developers in the Lazarus Forum made numerous suggestions on 
how to improve the speed of the Object Pascal version. I tried 
everything they suggested and maybe gained 2-5 FPS in the end. Still 
nothing compared to the performance of the Java or C versions, where no 
manual optimisation was applied.


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