March 25, 2010
On 25 March 2010 17:17, Brad Roberts <braddr at puremagic.com> wrote:
> How's it compare to gmp?

Those numbers include memory allocation, which I've made no attempt to
optimize. The low-level asm routines are pretty close to optimal on
x86, I believe they are faster than gmp 4 in a few cases (the addition
routine beats anything I've seen elsewhere). But I expect that gmp has
done a lot of work on the glue layer to keep overheads down, and they
add up to being significant.
Also I've only implemented Karatsuba multiplication, which means gmp
will win on algorithmic complexity at a couple of hundred machine
words. But I would expect it to be at least within a factor of 2 of
gmp below that point.


Here's something I find hilarious: Google for "faster than gmp". Click on the first hit. It's by one of the developers of the Magma computer algebra system. Click on the link to his homepage, and take a look at the photo. Then compare to the photo of me from the D conference. Can you see the resemblance?

He's not only my cousin, in fact his mother and my mother are identical twins. I had no idea until now that he'd done work on bigint stuff. I just couldn't believe it. Must be genetic.
April 09, 2010
Andrei Alexandrescu wrote:
> On 03/18/2010 10:46 PM, Don Clugston wrote:
>> (2)  Syntax for conversion to string is undecided. Strawman:
>>
>>   void toString(void delegate(const(char)[]) sink, string format);
>>
>> [...]
>>
>> Eventually, whatever is chosen will require some changes to std.format, but I'd just like to get a reasonable first cut for the initial release.
> 
> That's fine; we need to look again at std.format anyway.


Since Complex needs a toString() function as well, I am wondering:  Has the above been decided on as the standard for to-string conversion?

I'm asking because the newest part of std.format seems to be formattedWrite(), which writes to an output range.  Thus, an alternative would be

   void toString(OutputRange writer, string format);

IMO this seems more flexible, since the sink delegate solution is easily implemented as a trivial output range.  You can't necessarily do it the other way around (for instance, it requires quite a bit of typing if you just want toString to fill a buffer array).

Whatever it is, there really should be a standard signature, so that library and user types may work seamlessly with the writef*(), format() and to!string() functions.

-Lars
May 29, 2010
I'm replying to a stream of earlier messages.

Regarding toString etc., I hope to get some work done on that this weekend.


Andrei

On 04/09/2010 08:38 AM, Lars Tandle Kyllingstad wrote:
> Andrei Alexandrescu wrote:
>> On 03/18/2010 10:46 PM, Don Clugston wrote:
>>> (2) Syntax for conversion to string is undecided. Strawman:
>>>
>>> void toString(void delegate(const(char)[]) sink, string format);
>>>
>>> [...]
>>>
>>> Eventually, whatever is chosen will require some changes to std.format, but I'd just like to get a reasonable first cut for the initial release.
>>
>> That's fine; we need to look again at std.format anyway.
>
>
> Since Complex needs a toString() function as well, I am wondering: Has the above been decided on as the standard for to-string conversion?
>
> I'm asking because the newest part of std.format seems to be formattedWrite(), which writes to an output range. Thus, an alternative would be
>
> void toString(OutputRange writer, string format);
>
> IMO this seems more flexible, since the sink delegate solution is easily implemented as a trivial output range. You can't necessarily do it the other way around (for instance, it requires quite a bit of typing if you just want toString to fill a buffer array).
>
> Whatever it is, there really should be a standard signature, so that
> library and user types may work seamlessly with the writef*(), format()
> and to!string() functions.
>
> -Lars
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
1 2
Next ›   Last »