willem schreef:
Peter Vreman wrote:
At 17:01 1-1-2008, you wrote:
Vincent Snijders wrote:
willem schreef:

Benchmark results from :
http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&lang=all#about Conclusion : It would be good to have a compiler switch that optimizes for speed.

That is a wrong conclusion. All these programs were compiled for speed and not for low memory use.

Vincent
No I mean a new G1 switch who optimizes 30% better at the expensive of memory usage.
The memory usage may be ten times greater than the G switch.

I think your view is a bit too simplistic. Optimizing code is a complex task and we are continuusly working on it. Ofcourse patches to improve the optimizer of the compiler are always welcome. Simply refering to a couple of, already known, benchmarks will not help to get things improved. Besides that Free Pascal does a fairly good job against the other commericially funded compilers.

Peter
Yes optimizing code is a complex job.
The Free Pascal compiler does already a lots of optimization.
Like constant merging, shifts in stead of multiply, stack frame omission and so on.

But the Free Pascal compiler performs bad in the Mandelbrot benchmark.

number 1 is C++ g++
number 4 is Java 6
number 19 is Free Pascal

In the test Cpu time as N increases

number 3 is C gcc
number 18 is Java 6
number 26 is Free Pascal

I did download the Mandelbrot pascal source and I compiled it in the Lazarus Ide.
I got two hints about the ov div instead of / .
and I got a runtime error when I tried to run this programm.

The problem lies in the conversion from integer to real and vice versa.

When I did a expliciet conversion from real to integer with round(), the Mandelbrot benchmark runs fine.

How much speed improvement did that give? Did it give the exact same results?
Where are reals converted to integers?


If you implement the G1 switch which an automic conversion the / arithmic operator to div operator then you gain speed at the cost of memory usage. The developer can then always use the aritmic operator / .


var
  cx : double
  i, j: integer;

  i := 3; j := 4;

  cx := i / j; (cx = 0.75)
  cx := i div j; (cx = 0)

The results are different. So this optimization is not correct.

Vincent

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to