[racket] slow g^x=h mod p meet in the middle code

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Feb 28 22:26:06 EST 2014

Thanks Cristian. 

Man a full day away from my email and good things happen. 
I should do this more often. 


On Feb 28, 2014, at 2:48 PM, Neil Toronto wrote:

> Well done. I would never have thought of compiling with CGC.
> 
> Neil ⊥
> 
> On 02/28/2014 11:46 AM, Matthew Flatt wrote:
>> Cristian determined that Racket really was was much slower for the
>> program on Windows than on other platforms, and he also noticed that
>> RacketCGC was significantly faster.
>> 
>> That information pointed me to a simple inefficiency in the way Racket
>> allocated for GMP with the default collector. I've pushed a repair, and
>> Matthias's version of the program (which is a little faster than the
>> original) now runs about 4 times as fast on my machine (similar to the
>> Java version).
>> 
>> Fixing the bug was easy. The hard work was recognizing that something
>> was wrong and in what circumstances --- so thanks to everyone for that,
>> especially Cristian.
>> 
>> At Thu, 27 Feb 2014 19:10:06 -0500, Eric Dong wrote:
>>> On my computer the Java program takes 7 seconds. So you should be seeing a
>>> 3x slowdown with Racket.
>>> 
>>> You seem to see a 20x slowdown. This is very strange. How much RAM do you
>>> have? Racket performs very poorly when its memory is swapped out to disk.
>>> 
>>> To the rest of the list: is there any inefficiency with Racket on Windows
>>> that could cause this massive slowdown?
>>> 
>>> 
>>> On Thu, Feb 27, 2014 at 6:34 PM, Cristian Baboi
>>> <cristian.baboi at gmail.com>wrote:
>>> 
>>>> 
>>>> 
>>>> On 28 februarie 2014 01:13:46 EET, Eric Dong <yd2dong at uwaterloo.ca> wrote:
>>>> 
>>>>> Windows shouldn't be much slower though. What CPU model do you have?
>>>>> (2.0
>>>>> GHz can be fast or slow depending on your CPU model)
>>>>> 
>>>> 
>>>> AMD Athlon 3800+ X2
>>>> 
>>>> 
>>>> Also, can you post a Python program that runs much faster? Maybe it is
>>>>> only
>>>>> your computer which is slow, and it would be even slower running the
>>>>> Python
>>>>> 
>>>> 
>>>> I attached a Java program  I tested and it ran much faster. 13 s.
>>>> 
>>>> I cannot test python because I don't have it installed and require some
>>> libraries for big number arithmetic. I don't know python.
>>>> 
>>>> 
>>> ____________________
>>>   Racket Users list:
>>>   http://lists.racket-lang.org/users
>> ____________________
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>> 
> 
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users



Posted on the users mailing list.