[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [computer-go] Pattern Matcher
I have had 100 challenges before already.
I remember a gofer versus C challenge.
My statement was: "a good imperative programmer perhaps has to write extra
code in his favourite language for a CGI script, but it is easy to read and
very easy to hack a program to parse text".
A professor stated: "no way gofer is functional, parsing is genius with
those languages".
So a PHD student challenged me.
We started writing a parser for some website.
After 30 minutes i was finished and it worked bugfree.
He still must finish.
At 12:12 9-11-2004 -0200, Mark Boon wrote:
>
>
>> -----Original Message-----
>> From: computer-go-bounces@xxxxxxxxxxxxxxxxx
>> [mailto:computer-go-bounces@xxxxxxxxxxxxxxxxx]On Behalf Of Vincent
>> Diepeveen
>> Sent: Tuesday, November 09, 2004 12:05
>> To: computer-go; computer-go
>> Subject: RE: [computer-go] Pattern Matcher
>>
>>
>> At 11:54 9-11-2004 -0200, Mark Boon wrote:
>> >
>> >
>> >> -----Original Message-----
>> >> From: computer-go-bounces@xxxxxxxxxxxxxxxxx
>> >> [mailto:computer-go-bounces@xxxxxxxxxxxxxxxxx]On Behalf Of Frank de Groot
>> >> Sent: Tuesday, November 09, 2004 11:49
>> >> To: computer-go
>> >> Subject: Re: [computer-go] Pattern Matcher
>> >>
>> >>
>> >> From: "John Tromp" <John.Tromp@xxxxxxxxxxxxxxxxx>
>> >> Subject: Re: [computer-go] Pattern Matcher
>> >>
>> >>
>> >>
>> >> > It uses 2 modulo operations per lookup.
>> >> >
>> >> > > modulo and divide are like a 46+ cycles at opteron, and like
>> >> 200 cycles
>> >> or
>> >> > > so at a P4?
>> >> >
>> >> > What can I say, P4s suck:-(
>> >>
>> >>
>> >> Why don't you use an AND?
>> >> Vincent already mentioned that.
>> >> A simple AND is the same as a modulo, n'est-ce pas?
>> >
>> >Yes. Provided you use a power of two. But the speedup should
>> show both in C
>> >and in Java. If anything I'd think it would close the
>> performance gap rather
>> >than making it bigger. Maybe worth a try.
>>
>> Simple math shows the oppostie Mark.
>>
>> Suppose you have 2 instances:
>>
>> J
>> C
>>
>> Let's assume J = 2.6
>> Let's assume C = 2.0
>>
>> So 30% speed difference in favor C.
>>
>> Now we remove from both 1.5, as it gets faster.
>>
>> J ==> 1.1
>> C ==> 0.5
>>
>> Now J is slower : 1.1 / 0.5 = 2.2 times
>>
>
>You're right about your math, if that's really how it turns out. Whichever
>way, I still consider all of this just talk. Why not prove it? Make it run 3
>times faster.
>
>_______________________________________________
>computer-go mailing list
>computer-go@xxxxxxxxxxxxxxxxx
>http://www.computer-go.org/mailman/listinfo/computer-go/
>
>
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/