Thread overview | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 31, 2015 Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
I found this repository (reddit!) that hosts common benchmarks for many languages such as D, Nim, Go, python, C, etc... It uses only standard structures not to influence the benchmark. https://github.com/kostya/benchmarks |
March 31, 2015 Re: Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
Posted in reply to cym13 | On Tuesday, 31 March 2015 at 18:20:05 UTC, cym13 wrote:
> I found this repository (reddit!) that hosts common benchmarks for many languages such as D, Nim, Go, python, C, etc... It uses only standard structures not to influence the benchmark.
>
> https://github.com/kostya/benchmarks
Can you provide the Reddit link? Right off on the Brainfuck example, the author used a class instead of a struct, and none of the methods were marked final.
|
March 31, 2015 Re: Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
Posted in reply to Meta | On Tuesday, 31 March 2015 at 18:32:25 UTC, Meta wrote: > On Tuesday, 31 March 2015 at 18:20:05 UTC, cym13 wrote: >> I found this repository (reddit!) that hosts common benchmarks for many languages such as D, Nim, Go, python, C, etc... It uses only standard structures not to influence the benchmark. >> >> https://github.com/kostya/benchmarks > > Can you provide the Reddit link? Right off on the Brainfuck example, the author used a class instead of a struct, and none of the methods were marked final. Here it is: http://www.reddit.com/r/programming/comments/30y9mk I don't think the author is an experienced D programmer, but that's maybe why I find it interesting. That shows what a new naïve user can expect as a first result. |
March 31, 2015 Re: Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
Posted in reply to cym13 | On 3/31/15 11:35 AM, cym13 wrote:
> On Tuesday, 31 March 2015 at 18:32:25 UTC, Meta wrote:
>> On Tuesday, 31 March 2015 at 18:20:05 UTC, cym13 wrote:
>>> I found this repository (reddit!) that hosts common benchmarks for
>>> many languages such as D, Nim, Go, python, C, etc... It uses only
>>> standard structures not to influence the benchmark.
>>>
>>> https://github.com/kostya/benchmarks
>>
>> Can you provide the Reddit link? Right off on the Brainfuck example,
>> the author used a class instead of a struct, and none of the methods
>> were marked final.
>
> Here it is:
>
> http://www.reddit.com/r/programming/comments/30y9mk
>
> I don't think the author is an experienced D programmer, but that's
> maybe why I find it interesting. That shows what a new naïve user can
> expect as a first result.
Oh boy all classes with one-liner non-final methods. Manu must be dancing a gig right now :o). -- Andrei
|
March 31, 2015 Re: Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 3/31/15 11:44 AM, Andrei Alexandrescu wrote:
> On 3/31/15 11:35 AM, cym13 wrote:
>> On Tuesday, 31 March 2015 at 18:32:25 UTC, Meta wrote:
>>> On Tuesday, 31 March 2015 at 18:20:05 UTC, cym13 wrote:
>>>> I found this repository (reddit!) that hosts common benchmarks for
>>>> many languages such as D, Nim, Go, python, C, etc... It uses only
>>>> standard structures not to influence the benchmark.
>>>>
>>>> https://github.com/kostya/benchmarks
>>>
>>> Can you provide the Reddit link? Right off on the Brainfuck example,
>>> the author used a class instead of a struct, and none of the methods
>>> were marked final.
>>
>> Here it is:
>>
>> http://www.reddit.com/r/programming/comments/30y9mk
>>
>> I don't think the author is an experienced D programmer, but that's
>> maybe why I find it interesting. That shows what a new naïve user can
>> expect as a first result.
>
> Oh boy all classes with one-liner non-final methods. Manu must be
> dancing a gig right now :o). -- Andrei
(gigue?)
|
March 31, 2015 Re: Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 3/31/15 11:45 AM, Andrei Alexandrescu wrote: > On 3/31/15 11:44 AM, Andrei Alexandrescu wrote: >> On 3/31/15 11:35 AM, cym13 wrote: >>> On Tuesday, 31 March 2015 at 18:32:25 UTC, Meta wrote: >>>> On Tuesday, 31 March 2015 at 18:20:05 UTC, cym13 wrote: >>>>> I found this repository (reddit!) that hosts common benchmarks for >>>>> many languages such as D, Nim, Go, python, C, etc... It uses only >>>>> standard structures not to influence the benchmark. >>>>> >>>>> https://github.com/kostya/benchmarks >>>> >>>> Can you provide the Reddit link? Right off on the Brainfuck example, >>>> the author used a class instead of a struct, and none of the methods >>>> were marked final. >>> >>> Here it is: >>> >>> http://www.reddit.com/r/programming/comments/30y9mk >>> >>> I don't think the author is an experienced D programmer, but that's >>> maybe why I find it interesting. That shows what a new naïve user can >>> expect as a first result. >> >> Oh boy all classes with one-liner non-final methods. Manu must be >> dancing a gig right now :o). -- Andrei > > (gigue?) Let's see: https://github.com/kostya/benchmarks/pull/4 |
March 31, 2015 Re: Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 03/31/2015 08:46 PM, Andrei Alexandrescu wrote:
>
> Let's see: https://github.com/kostya/benchmarks/pull/4
Please fire up a profiler, you never know anything.
|
March 31, 2015 Re: Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | On 3/31/15 11:47 AM, Martin Nowak wrote:
> On 03/31/2015 08:46 PM, Andrei Alexandrescu wrote:
>>
>> Let's see: https://github.com/kostya/benchmarks/pull/4
>
> Please fire up a profiler, you never know anything.
True. I don't have time to put this on my plate, does anyone? -- Andrei
|
March 31, 2015 Re: Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | > Oh boy all classes with one-liner non-final methods. Manu must be dancing a gig right now :o). -- Andrei
Jig. =)
|
March 31, 2015 Re: Benchmark of D against other languages | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 03/31/2015 09:07 PM, Andrei Alexandrescu wrote: > > True. I don't have time to put this on my plate, does anyone? -- Andrei Very little, here is my outcome. - brainfuck => better backend, better AA The switch in the run loop doesn't use a switch table. A lot of time is also spent on AA lookup. - base64 => Base64.decode could be optimized It's already quite OK, but a few things could be done better. https://issues.dlang.org/show_bug.cgi?id=14384 - JSON => replace std.json, better AA and GC std.json is horribly bad + slow AA + slow GC. It got almost 3x faster with the new GC changes though. - matmul => need linear algebra library Can use std.numeric.dotProduct making it 33% faster. https://github.com/kostya/benchmarks/pull/6 A good linear algebra library could radically improve this. - havlak => alternative memory management, better AA and GC Got ~30% faster by the recent GC improvements. People too often new classes/create arrays like crazy (in loops). Using alternative memory management schemes is non-obvious or simply too hard. Action Points: - I'll ask him to use dmd 2.067.0 and add ldc. - We should finally acknowledge that dmd's backend has no future for optimized code. - D's AA is really slow, because of the C-ish interface. Making AA's a library type is mandatory, but difficult (already failed thrice). I outlined clear acceptance criteria for a good AA implementation here https://github.com/D-Programming-Language/druntime/pull/934#issuecomment-65916801. I currently lean towards adding a new implementation as `AA!(Key, Value)` while slowly deprecating any semantic of the builtin AA that can't be supported in a library implementation, then switching the implementations. Changing the builtin AA to a library type would break a lot of code, because of the subtle semantic/attribute differences. - We have a phobos candidate for a std.json replacement that comes with a pull parser, we should move it to std.experimental asap. http://code.dlang.org/packages/std_data_json - The GC can never be fast enough, but we're already working on it. - Make GC alternatives more prominent, e.g. tell people to favor structs over classes. - Add getOrSet to AA Simple optimization for a common use-case. https://issues.dlang.org/show_bug.cgi?id=14386 - Use open addressing for AA Considerable speeds up AA, fairly simple to implement. https://issues.dlang.org/show_bug.cgi?id=14385 Now I spent way more than 1 hour on this ;). -Martin |
Copyright © 1999-2021 by the D Language Foundation