[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
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
[]
Note this is only a very small speedup of a factor 2 compared to original
java time, where a much bigger speedup trivial is possible here. More like
factor 20.
>>
>> _______________________________________________
>> 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/
>
>
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/