Jump to page: 1 2 3
Thread overview
Benchmark Dlang vs Node vs Ruby
May 27, 2016
llaine
May 27, 2016
Vadim Lopatin
May 27, 2016
llaine
May 27, 2016
llaine
May 27, 2016
bob belcher
May 27, 2016
Adam D. Ruppe
May 27, 2016
yazd
May 27, 2016
Adam D. Ruppe
May 27, 2016
llaine
May 27, 2016
Daniel Kozak
May 27, 2016
llaine
May 27, 2016
llaine
May 27, 2016
yazd
May 27, 2016
llaine
May 27, 2016
Rene Zwanenburg
May 27, 2016
Adam D. Ruppe
May 27, 2016
Rene Zwanenburg
May 27, 2016
llaine
May 27, 2016
Rene Zwanenburg
May 27, 2016
yawniek
May 27, 2016
llaine
May 27, 2016
llaine
May 27, 2016
Daniel Kozak
May 28, 2016
yawniek
May 27, 2016
Hi guys,

In my journey of learning about D I tried to benchmark D with Vibe.d vs node with express and Ruby with Sinatra.

And the results are pretty surprising.
I have to admit that I though D was more faster than that. How is this even possible ?

I am doing something wrong ?


Here are the numbers with the project :

https://github.com/llaine/benchmarks/blob/master/README.md


May 27, 2016
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
> Hi guys,
>
> In my journey of learning about D I tried to benchmark D with Vibe.d vs node with express and Ruby with Sinatra.
>
> And the results are pretty surprising.
> I have to admit that I though D was more faster than that. How is this even possible ?
>
> I am doing something wrong ?
>
>
> Here are the numbers with the project :
>
> https://github.com/llaine/benchmarks/blob/master/README.md

Probably node and Ruby cache PGSQL connection - keeping it open.

May 27, 2016
On Friday, 27 May 2016 at 13:54:20 UTC, Vadim Lopatin wrote:
> On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
>> Hi guys,
>>
>> In my journey of learning about D I tried to benchmark D with Vibe.d vs node with express and Ruby with Sinatra.
>>
>> And the results are pretty surprising.
>> I have to admit that I though D was more faster than that. How is this even possible ?
>>
>> I am doing something wrong ?
>>
>>
>> Here are the numbers with the project :
>>
>> https://github.com/llaine/benchmarks/blob/master/README.md
>
> Probably node and Ruby cache PGSQL connection - keeping it open.

How I'm suppose to do it ?
May 27, 2016
On Friday, 27 May 2016 at 13:54:20 UTC, Vadim Lopatin wrote:
> On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
>> Hi guys,
>>
>> In my journey of learning about D I tried to benchmark D with Vibe.d vs node with express and Ruby with Sinatra.
>>
>> And the results are pretty surprising.
>> I have to admit that I though D was more faster than that. How is this even possible ?
>>
>> I am doing something wrong ?
>>
>>
>> Here are the numbers with the project :
>>
>> https://github.com/llaine/benchmarks/blob/master/README.md
>
> Probably node and Ruby cache PGSQL connection - keeping it open.

Okay I'll manage to do it, but still the req/sec are pretty low ...
May 27, 2016
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
> Hi guys,
>
> In my journey of learning about D I tried to benchmark D with Vibe.d vs node with express and Ruby with Sinatra.
>
> And the results are pretty surprising.
> I have to admit that I though D was more faster than that. How is this even possible ?
>
> I am doing something wrong ?
>
>
> Here are the numbers with the project :
>
> https://github.com/llaine/benchmarks/blob/master/README.md

You should know: https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=json&l=ft4

Dlang is quite slow. I have no idea way, or how to improve it. But clear, is not that fast. Maybe for web related is slow.
I'm more curious about more benchmarks :)
May 27, 2016
oooh, I wanna try my libs.

Where's your database dump?
May 27, 2016
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
> Hi guys,
>
> In my journey of learning about D I tried to benchmark D with Vibe.d vs node with express and Ruby with Sinatra.
>
> And the results are pretty surprising.
> I have to admit that I though D was more faster than that. How is this even possible ?
>
> I am doing something wrong ?
>
>
> Here are the numbers with the project :
>
> https://github.com/llaine/benchmarks/blob/master/README.md

The postgres library (dpq) that you're using doesn't use the event loop that vibe-d provides. Every call you are doing is blocking the whole server. Of course this is going to be slow.
You can try using http://code.dlang.org/packages/vibe-d-postgresql.
May 27, 2016
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
> I am doing something wrong ?

So, the benchmark, the Ruby, and the JS all use the path to be /.... the D seems to use /companies (though I don't know vibe). Is that right?
May 27, 2016
On Friday, 27 May 2016 at 14:17:16 UTC, Adam D. Ruppe wrote:
> On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
>> I am doing something wrong ?
>
> So, the benchmark, the Ruby, and the JS all use the path to be /.... the D seems to use /companies (though I don't know vibe). Is that right?

Yes it's that i'm routing to /companies to get the result, but let me change the psql library delete this routing and trying again.
May 27, 2016
On Friday, 27 May 2016 at 14:17:16 UTC, Adam D. Ruppe wrote:
> On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
>> I am doing something wrong ?
>
> So, the benchmark, the Ruby, and the JS all use the path to be /.... the D seems to use /companies (though I don't know vibe). Is that right?

All right after switching of psql client I had lower results actually ...

Req/Sec 22.85 for 30 seconds.

What are you using to do web if you don't user Vibe.d?
« First   ‹ Prev
1 2 3