[fpc-devel] Modernising Pascal

Eric Grange egrange at glscene.org
Fri Feb 25 15:18:52 CET 2005


> This is simply not true.
> If you don't belive then check the following:
> 1. Look with google for Quake rewrittiend into .Net (i.e. GC stuff) -- 
> surprise surprise -- difference is neglibile (<20%),

Though if you study more what they compare, you'll find that their
.Net version is actually running at about half-speed of the commercial version,
as they only compare their .Net version against a non-.Net version of the
same code running under their compiler, and surprise surprise, to do that
they had to change enough of the code to register a significant perf drop.

Also, Quake isn't really a GC test as the code allocates most of its data
only once, and then almost never uses dynamic memory.

> No worse that normal memory allocation, if GC is implemented properly.

Actually, that's incorrect, manual memory allocation has a constant
complexity cost if done properly (each alloc/free has a constant CPU
cost, whatever the amount of objects allocated or their size, just don't
use old fashioned linked-lists memory managers), while theoretically-
best-case-GC still isn't constant time (and practical ones are more
like O(n²)), GC memory allocation and heap compaction patterns are quite
cache unfriendly and will require partial or total freezes while they happen.

Eric




More information about the fpc-devel mailing list