Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Manlio Perillo
Bulat Ziganshin ha scritto: [...] but problem - not mine, but for haskellers, is that some people said that ghc can generate code that is as fast as gcc one. it will be stupid if someone will start to write say mpeg4 codec and after year of work will find that it need 100 Ghz cpu to work.

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Peter Verswyvelen
Most people in the games industry that I knew don't even know haskell. they are trained imperative hackers. However tim sweeney studies haskell, so it cetainly has influenced at least one well known game developer. But I wasn't saying that Haskell *is* used, I said one could use it for

Re: Re[6]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Peter Verswyvelen
nothing should stop you from writing video games in Haskell since video codec isn't video game :))) ouch, mea culpa, I misread your message. but I've worked with people that wrote physics engines in C/C++, and they also had to hand optimize specifically for a certain compiler to get

Re[3]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Bulat Ziganshin
Hello Louis, Saturday, February 21, 2009, 4:16:10 AM, you wrote: In the meantime, a brief summary: a minor correction: the best gcc result shown in the thread was 50x faster than Don's one, so you need to miltiple all ratios by a factor of 50 Straightforward and simple Haskell code, written

Re: Re[3]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Louis Wasserman
Observation: The best gcc result shown in the thread, if I recall, precomputed the result of the full computation at compiletime and simply outputted it, when we looked at the assembly. While I will accept that this could be seen as an optimization GHC should have made, I do not accept that this

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Daniel Fischer
Am Sonntag, 22. Februar 2009 00:21 schrieb Bulat Ziganshin: Hello Louis, Saturday, February 21, 2009, 4:16:10 AM, you wrote: In the meantime, a brief summary: a minor correction: the best gcc result shown in the thread was 50x faster than Don's one, so you need to miltiple all ratios by a

Re[5]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Bulat Ziganshin
Hello Louis, Sunday, February 22, 2009, 2:30:23 AM, you wrote: yes, you are right. Don also compared results of 64x-reduced computation with full one. are you think that these results are more fair? Observation: The best gcc result shown in the thread, if I recall, precomputed the result of

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Bulat Ziganshin
Hello Daniel, Sunday, February 22, 2009, 2:36:57 AM, you wrote: You're referring to the freak result of Dan Doel? Come on, be serious, please. I have a Haskell result that runs in 7ms, too. Just use a rewrite rule and hey presto :) Dan, why you have not said the same about test where ghc

Re: Re[5]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Louis Wasserman
I said nothing about fairness, and *never at any point said I thought Don's results were more useful or fair.* What makes you think that's what I meant to imply? You have not responded to my separate concern that For code that actively requires computation at runtime, I have seen no examples

Re: Re[5]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Sebastian Sylvan
On Sat, Feb 21, 2009 at 11:35 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Louis, Sunday, February 22, 2009, 2:30:23 AM, you wrote: yes, you are right. Don also compared results of 64x-reduced computation with full one. are you think that these results are more fair? Yes.

Re: Re[5]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Louis Wasserman
Sebastian, that's not Bulat's point. He's saying that if we make that optimization in Haskell, we should at least make the same optimization in GCC for fair comparison. (Though I'm not entirely sure that that optimization would be of any use to GCC, but that's a linguistic concern, no more.)

Re: Re[5]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Sebastian Sylvan
No, he asked if comparing the D64 version with the straight gcc one was more fair then comparing a version that precomputes the result with one that doesn't. That's what I responded to. On Sat, Feb 21, 2009 at 11:59 PM, Louis Wasserman wasserman.lo...@gmail.com wrote: Sebastian, that's not

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Daniel Fischer
Am Sonntag, 22. Februar 2009 00:50 schrieb Bulat Ziganshin: Hello Daniel, Sunday, February 22, 2009, 2:36:57 AM, you wrote: You're referring to the freak result of Dan Doel? Come on, be serious, please. I have a Haskell result that runs in 7ms, too. Just use a rewrite rule and hey presto

Re[7]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Bulat Ziganshin
Hello Sebastian, Sunday, February 22, 2009, 2:55:38 AM, you wrote: yes, you are right. Don also compared results of 64x-reduced computation with full one. are you think that these results are more fair? Yes. Clearly so. It still computes the result from scratch - it just uses a trick

Re: Re[7]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Sebastian Sylvan
On Sun, Feb 22, 2009 at 12:10 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Sebastian, Sunday, February 22, 2009, 2:55:38 AM, you wrote: yes, you are right. Don also compared results of 64x-reduced computation with full one. are you think that these results are more

Re[7]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Bulat Ziganshin
Hello Louis, Sunday, February 22, 2009, 2:59:05 AM, you wrote: Sebastian, that's not Bulat's point.  He's saying that if we make that optimization in Haskell, we should at least make the same optimization in GCC for fair comparison.  (Though I'm not entirely sure that that optimization would

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Don Stewart
Bulat, you've some serious lessons to learn on how to interact with online communities. First, 1. Stop posting replies to every post on this thread 2. Read some of the fine literature on how to be a productive, contributing member of a mailing list community,

Re: Re[7]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Louis Wasserman
Bulat, Thank you for being productive. =) of course these results are useful! my own goal was just to make fair comparison. i'm bothered when people said that ghc should be used for something like video codecs based on those let's optimize only for haskell pseudo-benchmarks. if Don was omitted

Re: Re[5]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread John A. De Goes
It's not practical at all. It's monstrously more complicated than C. It would be much simpler to do it in C and use FFI. Regards, John A. De Goes N-BRAIN, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Feb 21, 2009, at 4:55 PM, Sebastian Sylvan

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Ian Lynagh
I think this thread has stopped being useful and started going round in circles, so I've blocked all messages to it and... On Sat, Feb 21, 2009 at 04:28:21PM -0800, Donald Bruce Stewart wrote: I'm setting your moderation bit now ...reverted this. Thanks Ian

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: execution times: sum: ghc 6.6.1 -O2 : 12.433 secs ghc 6.10.1 -O2 : 12.792 secs sum-fast: ghc 6.6.1 -O2 : 1.919 secs ghc 6.10.1 -O2 : 1.856 secs ghc 6.10.1 -O2 -fvia-C

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread ChrisK
On a G4: s.hs (which does not need bang patterns) is: main = seq (sum0 (10^9) 0) (return ()) sum0 :: Int - Int - Int sum0 0 acc = acc sum0 x acc = sum0 (x-1) $! (acc+x) And s.c is (actually including 10^9, which Bulat's did not): main() { int sum=0; for(int i=1000*1000*1000; i0; i--)

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Peter Verswyvelen
When I change the C++ program into: int n; scanf(%d, n); for(i=0; in;i++) { sum += i; } GCC need 100 milliseconds on my 3.0GHz new Xeon with loop unrolling enabled. Without loop unrolling GCC needs about 635ms Visual C++ does it in 577 ms, generating the following code: loop: add

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Achim, Friday, February 20, 2009, 5:44:44 PM, you wrote: Nice! Now we know that gcc can calculate faster than Haskell can calculate and print. Next time, use exitWith, please. it was done in order to simplify sources. are you really believe that ghc needs more than 1 millisecond to

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Colin Paul Adams
Peter == Peter Verswyvelen bugf...@gmail.com writes: Peter So GHC is about 3 to 4 times slower as Visual C++ / GCC Peter without loop unrolling, which is not too bad since GHC does Peter not perform register optimization and loop unrolling yet Peter no? I would call it rather

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Peter, Friday, February 20, 2009, 6:18:50 PM, you wrote: So GHC is about 3 to 4 times slower as Visual C++ / GCC without loop unrolling why stop on disabling loop unrolling? there are lot of options we can use if we want to make gcc slower :D -- Best regards, Bulat

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Achim, Friday, February 20, 2009, 5:44:44 PM, you wrote: Nice! Now we know that gcc can calculate faster than Haskell can calculate and print. Next time, use exitWith, please. it was done in order to simplify sources. are you

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Peter Verswyvelen
Well C# does it with a for loop in 2300ms, and when using a IEnumerable sequence it needs 19936ms. Very much like the Haskell code. But of course the Haskell code could optimize the sum I guess, I assume it is using the lazy version of sum by default. Anyway it was more of a question. Does GHC

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Achim, Friday, February 20, 2009, 6:25:31 PM, you wrote: it was done in order to simplify sources. are you really believe that ghc needs more than 1 millisecond to print one number? :) Well, I know that (Show a) is about as slow as you can get. yes, but it's printed only once against

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Peter, Friday, February 20, 2009, 6:34:04 PM, you wrote: Well C# does it with a for loop in 2300ms, and when using a IEnumerable sequence it needs 19936ms. Very much like the Haskell code. But of course the Haskell code could optimize the sum I guess, I assume it is using the lazy

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Peter, Friday, February 20, 2009, 6:34:04 PM, you wrote: Well C# does it with a for loop in 2300ms, and when using a IEnumerable sequence it needs__19936ms. Very much like the Haskell code. But of course the Haskell code could

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Don Stewart d...@galois.com wrote: No! This is not how open source works! You *should submit bug reports* and *analysis*. It is so so much more useful than complaining and throwing stones. Exactly. I don't know where, but I read that the vast majorities of Linux bugs are reported, nailed, and

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
barsoap: Don Stewart d...@galois.com wrote: No! This is not how open source works! You *should submit bug reports* and *analysis*. It is so so much more useful than complaining and throwing stones. Exactly. I don't know where, but I read that the vast majorities of Linux bugs are

Re: Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Claus Reinke
Concrete examples always help, thanks. Turning this into a ticket with associated test will: - enable others to find and repeat the test when this thread is long gone, to see whether any other ghc changes have helped in any way - enable documentation of what exactly the issue is (why is it

Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Claus, Friday, February 20, 2009, 11:15:59 PM, you wrote: Turning this into a ticket with associated test will: but why you think that this is untypical and needs a ticket? ;) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Don Stewart d...@galois.com wrote: (The bang patterns aren't needed). Note how he counts backwards from 10^9. Was there a reason for that, Bulat? Tests against zero are faster, as you don't need a second operand... by now, some platforms might be smart enough, but down-counting in loops is

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Claus, Friday, February 20, 2009, 11:15:59 PM, you wrote: Turning this into a ticket with associated test will: but why you think that this is untypical and needs a ticket? ;) Bulat, you are right in every aspect. You never did

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
claus.reinke: Concrete examples always help, thanks. In simple enough situations, one can roll one's own loop unrolling;), somewhat like shown below (worker/wrapper split to bring the function parameter representing the loop body into scope, then template haskell to unroll its applications

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Achim, Friday, February 20, 2009, 11:44:49 PM, you wrote: Turning this into a ticket with associated test will: but why you think that this is untypical and needs a ticket? ;) Bulat, you are right in every aspect. You never did anything wrong. Achim, this is simplest code one can

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
bulat.ziganshin: Hello Achim, Friday, February 20, 2009, 11:44:49 PM, you wrote: Turning this into a ticket with associated test will: but why you think that this is untypical and needs a ticket? ;) Bulat, you are right in every aspect. You never did anything wrong. Achim,

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
dons: bulat.ziganshin: Hello Achim, Friday, February 20, 2009, 11:44:49 PM, you wrote: Turning this into a ticket with associated test will: but why you think that this is untypical and needs a ticket? ;) Bulat, you are right in every aspect. You never did anything

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bryan O'Sullivan
On Fri, Feb 20, 2009 at 12:44 PM, Achim Schneider bars...@web.de wrote: Bulat, you are right in every aspect. You never did anything wrong. Back when you debugged your code all night long, you were only dreaming. Achim, this doesn't seem like a constructive way to respond. Bulat's already

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Manlio Perillo
Don Stewart ha scritto: dons: bulat.ziganshin: Hello Achim, Friday, February 20, 2009, 11:44:49 PM, you wrote: Turning this into a ticket with associated test will: but why you think that this is untypical and needs a ticket? ;) Bulat, you are right in every aspect. You never did

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: so - why YOU think that ghc generates fast code and this example is something unusual? I think ghc has decent performance, and that there's room for improvement. I don't care whether you compare it to gcc, malbolge, or hand-written assembly,

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Manlio, Saturday, February 21, 2009, 12:54:00 AM, you wrote: ghc -O2 naive left fold15.680 As a full comparison I would like to see time for ghc -O0 naive left fold he is still waiting :))) but that's really has only theoretical interest, comparing ghc -O2 on

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Bryan O'Sullivan b...@serpentine.com wrote: On Fri, Feb 20, 2009 at 12:44 PM, Achim Schneider bars...@web.de wrote: Bulat, you are right in every aspect. You never did anything wrong. Back when you debugged your code all night long, you were only dreaming. Achim, this doesn't

Re: Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 20 Feb 2009, at 22:57, Bulat Ziganshin wrote: Hello Don, Saturday, February 21, 2009, 12:43:46 AM, you wrote: gcc -O3 -funroll-loops 0.318 ghc -funroll-loops -D64 0.088 So what did we learn here? nothing new: what you are not interested

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Don, Saturday, February 21, 2009, 12:43:46 AM, you wrote: gcc -O3 -funroll-loops 0.318 ghc -funroll-loops -D64 0.088 So what did we learn here? nothing new: what you are not

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Achim, Saturday, February 21, 2009, 12:54:33 AM, you wrote: so - why YOU think that ghc generates fast code and this example is something unusual? I think ghc has decent performance, and that there's room for improvement. I don't care whether you compare it to gcc, i'm asking

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Achim, Saturday, February 21, 2009, 1:17:08 AM, you wrote: nothing new: what you are not interested in real compilers comparison, preferring to demonstrate artificial results ...that we have a path to get better results than gcc -O3 -funroll-loops, and it's within reach... we even can

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 20 Feb 2009, at 23:33, Bulat Ziganshin wrote: Hello Achim, Saturday, February 21, 2009, 1:17:08 AM, you wrote: nothing new: what you are not interested in real compilers comparison, preferring to demonstrate artificial results ...that we have a path to get better results than gcc -O3

Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Thomas, Saturday, February 21, 2009, 1:19:47 AM, you wrote: I'm not sure what you're getting at Bulat √ it's been demonstrated that ghc is slower than gcc for most cases at the moment (many benchmarks will back this up), *however*, it's also easily verified that ghc has had

Re: Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 20 Feb 2009, at 23:41, Bulat Ziganshin wrote: Hello Thomas, Saturday, February 21, 2009, 1:19:47 AM, you wrote: I'm not sure what you're getting at Bulat √ it's been demonstrated that ghc is slower than gcc for most cases at the moment (many benchmarks will back this up), *however*, it's

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Thomas, Saturday, February 21, 2009, 1:41:24 AM, you wrote: You need look no further than the debian language shootout that things really aren't as bad as you're making out √ Haskell comes in in general less than 3x slower than gcc compiled C. you should look inside these tests, as i

Re: Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread minh thu
2009/2/20 Bulat Ziganshin bulat.zigans...@gmail.com: Hello Thomas, Saturday, February 21, 2009, 1:19:47 AM, you wrote: I'm not sure what you're getting at Bulat √ it's been demonstrated that ghc is slower than gcc for most cases at the moment (many benchmarks will back this up), *however*,

Re: Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 20 Feb 2009, at 23:52, Bulat Ziganshin wrote: Hello Thomas, Saturday, February 21, 2009, 1:41:24 AM, you wrote: You need look no further than the debian language shootout that things really aren't as bad as you're making out √ Haskell comes in in general less than 3x slower than gcc

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Thomas, Saturday, February 21, 2009, 1:41:24 AM, you wrote: so, again: this confirms that Don is always build artificial comparisons, optimizing Haskell code by hand and ignoring obvious ways You need look no further than the debian language shootout that things and yes - this is the

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
bulat.ziganshin: Hello Achim, Saturday, February 21, 2009, 1:17:08 AM, you wrote: nothing new: what you are not interested in real compilers comparison, preferring to demonstrate artificial results ...that we have a path to get better results than gcc -O3 -funroll-loops, and it's

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Ahn, Ki Yung
Thomas Davie wrote: You need look no further than the debian language shootout that things really aren't as bad as you're making out – Haskell comes in in general less than 3x slower than gcc compiled C. Of note, of all the managed languages, this is about the fastest – none of the other

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 21 Feb 2009, at 00:10, Ahn, Ki Yung wrote: Thomas Davie wrote: You need look no further than the debian language shootout that things really aren't as bad as you're making out – Haskell comes in in general less than 3x slower than gcc compiled C. Of note, of all the managed languages,

Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Thomas, Saturday, February 21, 2009, 1:55:33 AM, you wrote: most of these tests depends on libraries speed. in one test, PHP is 1st. from 2 or 3 tests that depends on compiler speed, one was fooled by adding special function readInt to ghc libs and the rest are written in low-level

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Don, Saturday, February 21, 2009, 1:55:19 AM, you wrote: This is extremely depressing to read after the good results and lessons of this thread. you misunderstand, it is not personal! We just want something to sarcasm on. Something specific. -- Best regards, Bulat

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: but problem - not mine, but for haskellers, is that some people said that ghc can generate code that is as fast as gcc one. it will be stupid if someone will start to write say mpeg4 codec and after year of work will find that it need 100 Ghz

Re: Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Peter Verswyvelen
nothing should stop you from writing video games in Haskell since the control logic of many video games is written in e.g. a scripting language like LUA :-) sure if you want to write a physics engine in Haskell, that's something else. but I've worked with people that wrote physics engines in

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Khudyakov Alexey alexey.sklad...@gmail.com wrote: On Friday 20 February 2009 16:29:29 Bulat Ziganshin wrote: Hello haskell-cafe, since there are no objective tests comparing ghc to gcc, i made my own one. these are 3 programs, calculating sum in c++ and haskell: main = print $

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Sebastian Sylvan
On Fri, Feb 20, 2009 at 10:33 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Achim, Saturday, February 21, 2009, 1:17:08 AM, you wrote: nothing new: what you are not interested in real compilers comparison, preferring to demonstrate artificial results ...that we have a

Re[6]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Peter, Saturday, February 21, 2009, 2:36:15 AM, you wrote: nothing should stop you from writing video games in Haskell since video codec isn't video game :))) but I've worked with people that wrote physics engines in C/C++, and they also had to hand optimize specifically for a certain

Re: Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Claus Reinke
Turning this into a ticket with associated test will: but why you think that this is untypical and needs a ticket? ;) Because generally ghc is doing a good-enough job. And it is doing that because long ago, ghc hq's war cry was if ghc generates code that is slower than any other haskell

Re: Re[6]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Ross Mellgren
Now perhaps I'll be stepping into some lines of fire as it seems like this thread is full of them. If I get in anyone's way please kindly hold your shot ;-) That said, video codecs are the kinds of things that usually benefit greatly from vectorization and parallelization right? These are

Re: Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread John Meacham
On Fri, Feb 20, 2009 at 11:51:43PM +0100, Thomas Davie wrote: of course. what fool will say that ghc cannot be optimized the same way as gcc? if we spent the same amount of time for improving ghc back-end as was spent for gcc (tens or hundreds man-years?), then *low-level* Haskell code will

[Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Achim Schneider
Peter Verswyvelen bugf...@gmail.com wrote: nothing should stop you from writing video games in Haskell Show me a studio that uses Haskell and I'd even accept dollars or pounds as payment. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Sebastian, Saturday, February 21, 2009, 2:42:33 AM, you wrote: Bulat, please, you're missing the point. actually you are missing the point. i mirror Don's non-attacking style of comments on my person. are you mentioned those Don letter? sure - no Nobody is saying that the

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Achim, Saturday, February 21, 2009, 2:37:55 AM, you wrote: not having enough weight in the shootout. For now, you can just use TH to force things getting evaluated. (Try to do that in C) they have Templates axe too :) -- Best regards, Bulat

Re: Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Isaac Gouy
--- On Fri, 2/20/09, Bulat Ziganshin bulat.zigans...@gmail.com wrote: -snip- You need look no further than the debian language shootout that things really aren't as bad as you're making out √ Haskell comes in in general less than 3x slower than gcc compiled C. you should look

Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Isaac, Saturday, February 21, 2009, 3:28:31 AM, you wrote: When did you look - six months ago? a year ago? 3 years ago? ah, again this argument. two weeks ago Don said that ghc changed a lot in 2 years, now when we see that there is no difference, he says that those loop optimizer is

Re: Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Sebastian Sylvan
On Sat, Feb 21, 2009 at 12:16 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Sebastian, Saturday, February 21, 2009, 2:42:33 AM, you wrote: Bulat, please, you're missing the point. actually you are missing the point. i mirror Don's non-attacking style of comments on my

Re: Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Sebastian Sylvan
I was intending to send this privately but clicked the wrong button. Apologies for adding even more noise to this discussion. On Sat, Feb 21, 2009 at 12:47 AM, Sebastian Sylvan syl...@student.chalmers.se wrote: On Sat, Feb 21, 2009 at 12:16 AM, Bulat Ziganshin bulat.zigans...@gmail.com

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Louis Wasserman
I am no longer sure that this conversation is producing useful information or a learning experience for any involved party, and suggest it ends. In the meantime, a brief summary: - Straightforward and simple Haskell code, written by an individual aware of issues with tail recursion and

Re: Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Isaac Gouy
--- On Fri, 2/20/09, Bulat Ziganshin bulat.zigans...@gmail.com wrote: From: Bulat Ziganshin bulat.zigans...@gmail.com Subject: Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc To: Isaac Gouy igo...@yahoo.com Cc: haskell-cafe@haskell.org Date: Friday, February 20, 2009, 4:43 PM Hello Isaac

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bertram Felgenhauer
Don Stewart wrote: If we take what I usually see as the best loops GHC can do for this kind of thing: import Data.Array.Vector main = print (sumU (enumFromToU 1 (10^9 :: Int))) And compile it: $ ghc-core A.hs -O2 -fvia-C -optc-O3 We get ideal core, all data structures

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Don Stewart
bertram.felgenhauer: This is odd, but it doesn't hurt the inner loop, which only involves $wsum01_XPd, and is identical to $wfold_s15t above. Checking the asm: $ ghc -O2 -fasm sQ3_info: .LcRt: cmpq 8(%rbp),%rsi jg .LcRw leaq 1(%rsi),%rax