NO

Author Topic: Code performance  (Read 4234 times)

Online AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Code performance
« on: May 29, 2009, 09:13:16 AM »
Jacob Navia published a piece of code for testing the performance of his compiler with 64 bit data.

http://groups.google.com/group/comp.compilers.lcc/browse_thread/thread/f7731d58e43c0c36/cc03070b070ead32?hl=en&lnk=gst&q=64+bit#cc03070b070ead32

I have also tested the performance of some compilers with this code.

My results:

Open Watcom ( 1.8 ):  ~3,85 sec
MinGW-GCC  ( 4.4 ):    ~2,50 sec
lcc-win32:                 ~2,72 sec
Visual Studio ( 6.0 ):   ~3,00 sec
Visual Studio ( 2008 ): ~2,50 sec
tcc (0.9.25):              ~4,86 sec
Pelles C ( 5.00.1 ):      ~3,61 sec
Pelles C ( 6.0RC2 ):     ~2,86 sec

You see Pelles C 6.0 has without a special optimization for 64 bit data nearly the same performance and the performance of the new compiler seems to be much better then Pelles C 5.0 (and it's performance was good).  ;)
« Last Edit: May 29, 2009, 05:20:21 PM by AlexN »
best regards
 Alex ;)

JohnF

  • Guest
Re: Code performance
« Reply #1 on: May 29, 2009, 05:43:10 PM »
Yes, PellesC is impressive. I tested that code (32bit) PellesC is faster than Lcc-Win32 and VC6.

John

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Code performance
« Reply #2 on: May 31, 2009, 12:27:59 PM »
OK, this is nice to hear. I have a few benchmarks myself, but many more tests to check that the compiler is doing "the right thing" (which is more important after all). The optimizer, the inliner, the use of intrinsics can help in some functions, but the new register allocator will help in many more functions, I think...
/Pelle

Online AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: Code performance
« Reply #3 on: June 01, 2009, 10:08:42 PM »
OK, this is nice to hear. I have a few benchmarks myself, but many more tests to check that the compiler is doing "the right thing" (which is more important after all). The optimizer, the inliner, the use of intrinsics can help in some functions, but the new register allocator will help in many more functions, I think...
You are right. The first thing I do with a new compiler is to check, if my most used programs are still working with it and then I try to check how fast are some programs are (and there was a suprising jump between Pelles C 5 and 6). When I find an error I write it, but it makes more fun to write something good.  ;)
best regards
 Alex ;)

aj

  • Guest
Re: Code performance
« Reply #4 on: June 02, 2009, 12:25:10 AM »
May I ask what kind of register allocator you are using Pelle, it'd be very interesting to hear what kind of decisions you've made when designing the compiler? SSA-form etc.? Is there any kind of vector optimizations in Pelles C?

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Code performance
« Reply #5 on: June 16, 2009, 10:21:45 PM »
The register allocator is based on the linear scan algorithm ( see also short text in the help file - "New global optimizer, function inliner, and register allocator" )

The general idea for this compiler has always been "good enough", but no more. The problem is that this is not a fixed position, and every third year (or whatever) this position is re-evaluated by me. Today the SSA form is generally accepted because it makes many optimizing algorithms simpler - so far I have only added a few (every algorithm takes time to implement and test). Vector optimizations are not done (yet), and many other things will be more important before I get there ...

( One way to find time to improve the compiler would be to drop support for the IDE, and some other uninteresting tools, but since most requests are about the IDE this may not be the best approach... )
/Pelle