www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - VIbe.d / Hunt / Actix

reply SrMordred <patric.dexheimer gmail.com> writes:
I´m starting to research about web frameworks for a future 
project.
One of the main focus are on performance.

So eventually i hit this site 
https://www.techempower.com/benchmarks/.

And started to compare Vibe.d and Hunt performances (and also 
another alternatives).
Vide.d in general are faster than Hunt, but i´m curious about 
Actix (Rust) which are way faster (up to 10x on some benchmarks).

And i´m curious , from a technical point of view, how is 
possible, since i don´t think there are any intrinsic qualities 
that Rust have that cannot be achieved by D.
Sep 21 2019
next sibling parent reply WebFreak001 <d.forum webfreak.org> writes:
On Saturday, 21 September 2019 at 19:23:42 UTC, SrMordred wrote:
 I´m starting to research about web frameworks for a future 
 project.
 One of the main focus are on performance.

 So eventually i hit this site 
 https://www.techempower.com/benchmarks/.

 And started to compare Vibe.d and Hunt performances (and also 
 another alternatives).
 Vide.d in general are faster than Hunt, but i´m curious about 
 Actix (Rust) which are way faster (up to 10x on some 
 benchmarks).

 And i´m curious , from a technical point of view, how is 
 possible, since i don´t think there are any intrinsic qualities 
 that Rust have that cannot be achieved by D.
I think in the benchmarks it's mostly bottlenecked by the database, which is why they improved so much in this round because of updates there. If you look at Plaintext and JSON Serialization (not using DB) you can see that while there is potential for improvement, it's not as drastic. Vibe.D's MongoDB isn't the most optimized one and not really the focus and the Postgres one seems to always be in front but also that probably needs improvements. I think the ones high in these text only benchmarks are the ones which extremely optimize for such plaintext cases. You can see simply nginx, the high performance load balancer / web server, being there with just 50%
Sep 21 2019
parent Daniel Kozak <kozzi11 gmail.com> writes:
On Sat, Sep 21, 2019 at 9:40 PM WebFreak001 via Digitalmars-d
<digitalmars-d puremagic.com> wrote:
 On Saturday, 21 September 2019 at 19:23:42 UTC, SrMordred wrote:
 I´m starting to research about web frameworks for a future
 project.
 One of the main focus are on performance.

 So eventually i hit this site
 https://www.techempower.com/benchmarks/.

 And started to compare Vibe.d and Hunt performances (and also
 another alternatives).
 Vide.d in general are faster than Hunt, but i´m curious about
 Actix (Rust) which are way faster (up to 10x on some
 benchmarks).

 And i´m curious , from a technical point of view, how is
 possible, since i don´t think there are any intrinsic qualities
 that Rust have that cannot be achieved by D.
I think in the benchmarks it's mostly bottlenecked by the database, which is why they improved so much in this round because of updates there. If you look at Plaintext and JSON Serialization (not using DB) you can see that while there is potential for improvement, it's not as drastic. Vibe.D's MongoDB isn't the most optimized one and not really the focus and the Postgres one seems to always be in front but also that probably needs improvements. I think the ones high in these text only benchmarks are the ones which extremely optimize for such plaintext cases. You can see simply nginx, the high performance load balancer / web server, being there with just 50%
No, the main issue is generaly with the basic http requests. db part is not perfect, but main issue is even in plaintext
Sep 21 2019
prev sibling next sibling parent reply Daniel Kozak <kozzi11 gmail.com> writes:
I have spent some time  (days, weeks, maybe months) to look at almost
all of this "fast" frameworks. And I can say only one thing. Almost
every one of them somehow cheat. So for me this framework does not
have any real value.

On Sat, Sep 21, 2019 at 9:25 PM SrMordred via Digitalmars-d
<digitalmars-d puremagic.com> wrote:
 I´m starting to research about web frameworks for a future
 project.
 One of the main focus are on performance.

 So eventually i hit this site
 https://www.techempower.com/benchmarks/.

 And started to compare Vibe.d and Hunt performances (and also
 another alternatives).
 Vide.d in general are faster than Hunt, but i´m curious about
 Actix (Rust) which are way faster (up to 10x on some benchmarks).

 And i´m curious , from a technical point of view, how is
 possible, since i don´t think there are any intrinsic qualities
 that Rust have that cannot be achieved by D.
Sep 21 2019
next sibling parent Gregor =?UTF-8?B?TcO8Y2ts?= <gregormueckl gmx.de> writes:
On Saturday, 21 September 2019 at 19:52:51 UTC, Daniel Kozak 
wrote:
 I have spent some time  (days, weeks, maybe months) to look at 
 almost all of this "fast" frameworks. And I can say only one 
 thing. Almost every one of them somehow cheat. So for me this 
 framework does not have any real value.
Could you give a brief overview on these "cheats"?
Sep 21 2019
prev sibling parent reply SrMordred <patric.dexheimer gmail.com> writes:
On Saturday, 21 September 2019 at 19:52:51 UTC, Daniel Kozak 
wrote:
 I have spent some time  (days, weeks, maybe months) to look at 
 almost all of this "fast" frameworks. And I can say only one 
 thing. Almost every one of them somehow cheat. So for me this 
 framework does not have any real value.
What u mean by cheated? They tweaked the code to perform better on the benchmarks?
Sep 21 2019
parent reply Daniel Kozak <kozzi11 gmail.com> writes:
On Saturday, 21 September 2019 at 20:15:55 UTC, SrMordred wrote:
 On Saturday, 21 September 2019 at 19:52:51 UTC, Daniel Kozak 
 wrote:
 I have spent some time  (days, weeks, maybe months) to look at 
 almost all of this "fast" frameworks. And I can say only one 
 thing. Almost every one of them somehow cheat. So for me this 
 framework does not have any real value.
What u mean by cheated? They tweaked the code to perform better on the benchmarks?
Sorry for using world cheat, what I really mean is tweaks. I mean things like this: https://github.com/TechEmpower/FrameworkBenchmarks/blob/dcbc03714d13aed9c179ed415fbd8fc9629fc6a5/frameworks/Rust/hyper/src/main.rs#L26 https://github.com/TechEmpower/FrameworkBenchmarks/blob/dcbc03714d13aed9c179ed415fbd8fc9629fc6a5/frameworks/Rust/hyper/src/main.rs#L52 https://github.com/TechEmpower/FrameworkBenchmarks/blob/dcbc03714d13aed9c179ed415fbd8fc9629fc6a5/frameworks/Rust/hyper/src/main.rs#L58 I do not thing, that in normal user code one would use this tweaks, and D vibed code does not use them neither
Sep 22 2019
parent SrMordred <patric.dexheimer gmail.com> writes:
On Monday, 23 September 2019 at 06:10:13 UTC, Daniel Kozak wrote:
 On Saturday, 21 September 2019 at 20:15:55 UTC, SrMordred wrote:
 On Saturday, 21 September 2019 at 19:52:51 UTC, Daniel Kozak 
 wrote:
 [...]
What u mean by cheated? They tweaked the code to perform better on the benchmarks?
Sorry for using world cheat, what I really mean is tweaks. I mean things like this: https://github.com/TechEmpower/FrameworkBenchmarks/blob/dcbc03714d13aed9c179ed415fbd8fc9629fc6a5/frameworks/Rust/hyper/src/main.rs#L26 https://github.com/TechEmpower/FrameworkBenchmarks/blob/dcbc03714d13aed9c179ed415fbd8fc9629fc6a5/frameworks/Rust/hyper/src/main.rs#L52 https://github.com/TechEmpower/FrameworkBenchmarks/blob/dcbc03714d13aed9c179ed415fbd8fc9629fc6a5/frameworks/Rust/hyper/src/main.rs#L58 I do not thing, that in normal user code one would use this tweaks, and D vibed code does not use them neither
Well this really looks like cheating :P But its interesting that this lib has this possibility of fine tuning the server. We don´t have anything like this in D, right? (micro http server?)
Sep 23 2019
prev sibling next sibling parent reply Newbie2019 <newbie2019 gmail.com> writes:
On Saturday, 21 September 2019 at 19:23:42 UTC, SrMordred wrote:
 I´m starting to research about web frameworks for a future 
 project.
 One of the main focus are on performance.

 So eventually i hit this site 
 https://www.techempower.com/benchmarks/.

 And started to compare Vibe.d and Hunt performances (and also 
 another alternatives).
 Vide.d in general are faster than Hunt, but i´m curious about 
 Actix (Rust) which are way faster (up to 10x on some 
 benchmarks).

 And i´m curious , from a technical point of view, how is 
 possible, since i don´t think there are any intrinsic qualities 
 that Rust have that cannot be achieved by D.
Vibe.d/Hunt use class/GC/exception. both of the framework use runtime interface to implement abstract. The poor memory management, and over kill abstract make D slow.
Sep 22 2019
parent Jacob Carlborg <doob me.com> writes:
On Monday, 23 September 2019 at 04:10:30 UTC, Newbie2019 wrote:

 Vibe.d/Hunt use class/GC/exception. both of the framework use 
 runtime interface to implement abstract.

 The poor  memory management, and over kill abstract make D slow.
It would be interesting to see how Mecca [1] would perform. It’s just missing HTTP support :). [1] https://github.com/weka-io/mecca — /Jacob Carlborg
Sep 23 2019
prev sibling parent reply zoujiaqing <zoujiaqing gmail.com> writes:
On Saturday, 21 September 2019 at 19:23:42 UTC, SrMordred wrote:
 I´m starting to research about web frameworks for a future 
 project.
 One of the main focus are on performance.

 So eventually i hit this site 
 https://www.techempower.com/benchmarks/.

 And started to compare Vibe.d and Hunt performances (and also 
 another alternatives).
 Vide.d in general are faster than Hunt, but i´m curious about 
 Actix (Rust) which are way faster (up to 10x on some 
 benchmarks).

 And i´m curious , from a technical point of view, how is 
 possible, since i don´t think there are any intrinsic qualities 
 that Rust have that cannot be achieved by D.
You can view latest test result: https://www.techempower.com/benchmarks/#section=test&runid=1580dba0-1ac1-4e3c-96f4-5747295d67a6&hw=ph&test=plaintext
Sep 23 2019
parent reply SrMordred <patric.dexheimer gmail.com> writes:
On Monday, 23 September 2019 at 07:19:46 UTC, zoujiaqing wrote:
 On Saturday, 21 September 2019 at 19:23:42 UTC, SrMordred wrote:
 You can view latest test result:

 https://www.techempower.com/benchmarks/#section=test&runid=1580dba0-1ac1-4e3c-96f4-5747295d67a6&hw=ph&test=plaintext
Very interesting , it blast way over on this benchmark. But it stays way behind on the others. Have an idea of why? (btw, i´m experimenting with vibe.d now and pretend to explore hunt also :) )
Sep 23 2019
parent kubo39 <kubo39 gmail.com> writes:
On Monday, 23 September 2019 at 16:14:15 UTC, SrMordred wrote:
 On Monday, 23 September 2019 at 07:19:46 UTC, zoujiaqing wrote:
 On Saturday, 21 September 2019 at 19:23:42 UTC, SrMordred 
 wrote:
 You can view latest test result:

 https://www.techempower.com/benchmarks/#section=test&runid=1580dba0-1ac1-4e3c-96f4-5747295d67a6&hw=ph&test=plaintext
Very interesting , it blast way over on this benchmark. But it stays way behind on the others. Have an idea of why? (btw, i´m experimenting with vibe.d now and pretend to explore hunt also :) )
I'm not sure, but I guess: * Rust's httparse crate uses AVX2 instruction if available, picohttpparser uses only SSE4.2 https://github.com/seanmonstar/httparse/pull/40 * Rust's hyper uses Date header cache mechanism https://github.com/hyperium/hyper/commit/bdd2e1a3adccfed54e2e9 53c914b5fbaaf7b513, which I try to implement for vibe.d https://github.com/vibe-d/vibe.d/pull/2012
Oct 02 2019