September 18, 2020
On Friday, 18 September 2020 at 12:11:58 UTC, Imperatorn wrote:
> On Sunday, 13 September 2020 at 21:16:52 UTC, ryuukk_ wrote:
>> On Sunday, 13 September 2020 at 21:09:55 UTC, Daniel Kozak wrote:
>>> On Sun, Sep 13, 2020 at 11:00 PM ryuukk_ via Digitalmars-d < digitalmars-d@puremagic.com> wrote:
>>>
>>>>
>>>> Concerning vibe.d, i'm worried about the dependencies it pulls, also the benchmark:
>>>>
>>>> https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=fortune&l=zijoc7-1r
>>>>
>>>> GO vs D, it performs quite poorly
>> I think the plain text one is the most important one to fix first, such basic concept shouldn't be that slow
>
> Did you take a look at hunt?
>
> https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=plaintext&l=zijoc7-1r

hunt looks promising but https://github.com/huntlabs/hunt-http/issues/20 = not so good
September 18, 2020
On Wednesday, 16 September 2020 at 19:14:57 UTC, Jacob Carlborg wrote:
> On 2020-09-13 22:58, ryuukk_ wrote:
>
>> [...]
>
> I did some benchmark on some real world code at my previous work. We compared the performance (number of requests per second) of an HTTP endpoint. It fetched some data from a PostgreSQL database, did some processing and returned the result as JSON.
>
> We compared a highly optimized version implemented in Ruby, this was the baseline. Then a colleague implemented a version in Go and I did an implementation in D, using vibe.d .
>
> The end result was that the Go version ran at 0.5x of the Ruby version and the D version ran at 5x of the Ruby version. This was without trying to optimize the code afterwards. Only some common sense while writing the code, like if you can do it at compile time, do that. I'm pretty sure I didn't even used LDC for an optimized build.
>
> Of course, everyone at the company was only talking about how on earth the Go version could be slower than the Ruby version. Someone later did some improvements so that the Go version was up to the same speed as Ruby. Nobody talked about how much faster the D version was, except me :( .

I also experienced it, i am rewritting most of my server services and so far i get huge gain in performance, this allowed me to downgrade the server and save money!

I plan to rewrite more, but i need better HTTP story..
September 18, 2020
On Friday, 18 September 2020 at 14:32:36 UTC, ryuukk_ wrote:
> On Wednesday, 16 September 2020 at 19:14:57 UTC, Jacob Carlborg wrote:
>> [...]
>
> I also experienced it, i am rewritting most of my server services and so far i get huge gain in performance, this allowed me to downgrade the server and save money!
>
> I plan to rewrite more, but i need better HTTP story..

* networking in general, not just HTTP
September 18, 2020
On Friday, 18 September 2020 at 14:32:36 UTC, ryuukk_ wrote:
>
> I also experienced it, i am rewritting most of my server services and so far i get huge gain in performance, this allowed me to downgrade the server and save money!
>
> I plan to rewrite more, but i need better HTTP story..

Just to be more specific, you are rewriting from Ruby to Go or was it D?
September 18, 2020
On Friday, 18 September 2020 at 14:50:15 UTC, IGotD- wrote:
> On Friday, 18 September 2020 at 14:32:36 UTC, ryuukk_ wrote:
>>
>> I also experienced it, i am rewritting most of my server services and so far i get huge gain in performance, this allowed me to downgrade the server and save money!
>>
>> I plan to rewrite more, but i need better HTTP story..
>
> Just to be more specific, you are rewriting from Ruby to Go or was it D?

java and some python to D
September 18, 2020
On 9/18/20 8:11 AM, Imperatorn wrote:
> On Sunday, 13 September 2020 at 21:16:52 UTC, ryuukk_ wrote:
>> On Sunday, 13 September 2020 at 21:09:55 UTC, Daniel Kozak wrote:
>>> On Sun, Sep 13, 2020 at 11:00 PM ryuukk_ via Digitalmars-d < digitalmars-d@puremagic.com> wrote:
>>>
>>>>
>>>> Concerning vibe.d, i'm worried about the dependencies it pulls, also the benchmark:
>>>>
>>>> https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=fortune&l=zijoc7-1r 
>>>>
>>>>
>>>> GO vs D, it performs quite poorly
>> I think the plain text one is the most important one to fix first, such basic concept shouldn't be that slow
> 
> Did you take a look at hunt?
> 
> https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=plaintext&l=zijoc7-1r 
> 

The plaintext benchmark looks fast, but note that the router is simply matching on the exact length of the path name used in the benchmark:

```
    override void onComplete(HttpRequest req) {
        string path = req.uri;
        if(path.length == plaintextLength) { // plaintext
            respondWith("Hello, World!", 200, textHeader);
        } else if(path.length == jsonLength) { // json
            JSONValue js = JSONValue(["message" : JSONValue("Hello, World!")]);
            respondWith(js.toJSON(), 200, jsonHeader);
        } else {
```

https://github.com/TechEmpower/FrameworkBenchmarks/blob/00fd915d843ce734f44a1af5385b4e321003bfee/frameworks/D/hunt/http/http/DemoProcessor.d#L43-L50
September 19, 2020
On Friday, 18 September 2020 at 14:31:20 UTC, ryuukk_ wrote:
> On Friday, 18 September 2020 at 12:11:58 UTC, Imperatorn wrote:
>> On Sunday, 13 September 2020 at 21:16:52 UTC, ryuukk_ wrote:
>>> On Sunday, 13 September 2020 at 21:09:55 UTC, Daniel Kozak wrote:
>>>> On Sun, Sep 13, 2020 at 11:00 PM ryuukk_ via Digitalmars-d < digitalmars-d@puremagic.com> wrote:
>>>>
>>>>> [...]
>>> I think the plain text one is the most important one to fix first, such basic concept shouldn't be that slow
>>
>> Did you take a look at hunt?
>>
>> https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=plaintext&l=zijoc7-1r
>
> hunt looks promising but https://github.com/huntlabs/hunt-http/issues/20 = not so good

Hmm, I'll try take a look later
September 20, 2020
On Saturday, 19 September 2020 at 17:15:03 UTC, Imperatorn wrote:
> On Friday, 18 September 2020 at 14:31:20 UTC, ryuukk_ wrote:
>> On Friday, 18 September 2020 at 12:11:58 UTC, Imperatorn wrote:
>>> On Sunday, 13 September 2020 at 21:16:52 UTC, ryuukk_ wrote:
>>>> On Sunday, 13 September 2020 at 21:09:55 UTC, Daniel Kozak wrote:
>>>>> On Sun, Sep 13, 2020 at 11:00 PM ryuukk_ via Digitalmars-d < digitalmars-d@puremagic.com> wrote:
>>>>>
>>>>>> [...]
>>>> I think the plain text one is the most important one to fix first, such basic concept shouldn't be that slow
>>>
>>> Did you take a look at hunt?
>>>
>>> https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=plaintext&l=zijoc7-1r
>>
>> hunt looks promising but https://github.com/huntlabs/hunt-http/issues/20 = not so good
>
> Hmm, I'll try take a look later

As a longterm vibe-d user I'm interested in this comparison too and this comes out of this: https://github.com/tchaloupka/httpbench

Hopefully it'd be useful - PR's are welcome.
January 10, 2021
On Wednesday, 16 September 2020 at 19:14:57 UTC, Jacob Carlborg wrote:
> The end result was that the Go version ran at 0.5x of the Ruby version and the D version ran at 5x of the Ruby version. This was without trying to optimize the code afterwards. Only some common sense while writing the code, like if you can do it at compile time, do that. I'm pretty sure I didn't even used LDC for an optimized build.

Apologies for replying to an old post, but "0.5x of Ruby" and "5x of Ruby" could be read to mean that the Go version ran in half the time of the Ruby version while the D version took 5 times as long to run.

> Of course, everyone at the company was only talking about how on earth the Go version could be slower than the Ruby version. Someone later did some improvements so that the Go version was up to the same speed as Ruby. Nobody talked about how much faster the D version was, except me :( .

Ok you meant Go version was half the performance of the Ruby version and D version was 5 times faster.

This reply hopefully adds context to search engine indexing when people look for D performance. :-)

January 10, 2021
On 2021-01-10 02:50, Pierce Ng wrote:

> Apologies for replying to an old post, but "0.5x of Ruby" and "5x of Ruby" could be read to mean that the Go version ran in half the time of the Ruby version while the D version took 5 times as long to run.

I can see now that could have been misunderstood. What was measured was requests per seconds, not execution time. So a higher value is better.

> Ok you meant Go version was half the performance of the Ruby version and D version was 5 times faster.

Yes.

-- 
/Jacob Carlborg
1 2 3
Next ›   Last »