D perfomance

Wulfklaue wulfklaue at wulfklaue.com
Sun Apr 26 21:30:27 UTC 2020


On Sunday, 26 April 2020 at 16:59:44 UTC, Daniel Kozak wrote:
> On Fri, Apr 24, 2020 at 3:46 PM serge via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>>
>> To me techempower stats is pretty good indicator - it shows 
>> json processing, single/multiquery requests, database, static. 
>> Overall performance across those stats give pretty good idea, 
>> how language and web framework is created, its ecosystem.
>
> Unfortunately there is a big issue with techempower. Because it 
> is so
> popular almost every framework [language] try to have a best 
> score in
> it.
> And in many cases this mean they use some hacks or tricks to 
> achieve
> that. So in general techempower results are useless.

As somebody who implemented the Swoole+PHP and Crystal code at 
Techempowered, i can state that this statement is factually wrong.

The code is very idiomatic code that anybody writes. Basic 
database calls, pool for connections, prepare statements, 
standard http module or frameworks. There is no magic in the code 
that try's to do direct system calls or has stripped down drivers 
or any other stuff that people normally will not use.

Where you can see some funny business, is in the top 10 a 20, 
where Rust and co have some extreme optimized code, that is not 
how most people will write the code. But those are the extreme 
cases, what anybody with half a brain ignores because that is not 
how your write normal code. I always say: Look at the code to see 
if the results are normal or over optimized/unrealistic crap.

If we compare normal implementations ( 
https://www.techempower.com/benchmarks/#section=test&runid=c7152e8f-5b33-4ae7-9e89-630af44bc8de&hw=ph&test=plaintext ) like

Futures:

vibed-ldc-pgsql: 58k
Crystal: 206k
PHP+Swoole: 289k

D's results are simply abysmal. We are talking basic idiomatic 
code here. This tells me more that D has a issue with its DB 
handling on those tests.

We need to look at stuff like "hello world" ( plain text ), json, 
where the performance difference drops down to 2x.

The plaintext is literally take a string and output it. We are 
talking route + echo in PHP and any other language. Or basic 
encoding a json and outputting it. A few lines of code, that is 
it. Yet D suffers still in those tests with a 2x issue. Does that 
not tell you that D or VibeD suffer from a actual performance 
issue? A point that clearly needs to be looked after.

If the argument is dat D is not properly optimized, then what are 
PHP+Workerman/Swoole/..., Crystal?


> Other issue with techempower benchmark is there is almost zero
> complexity. All tests do some basic operations on realy small
> datasets.

Futures shows a more realistic real world web scenario. The rest 
mostly show weaknesses in each language+framework specific 
section. If your json score is low, there is a problem with your 
json library or the way your framework handles the requests. If 
your plaintext results are low ... You get the drill.

If you simply try to scuff at a issue by stating "in real world 
we are faster" but you have benchmarks like this online... The 
nice things about techempowered is that it really shows if your 
language is fast for basic web tasks or not. It does not give a 
darn that your language can run "real world" fast, if there are 
underlying issues. For people who are interested in D for website 
hosting, its simply slower then the competitors.

Do not like it? Then see where the issues are and fix them. Be it 
in the techempowered code, in D or in VibeD. But clearly there is 
a issue if D can not compete with implementations of other 
languages ( again, talking normal implementations, stuff that 
anybody will use ).

If given the choice, what will people pick? D that simply ignores 
the web market or other languages/frameworks where the speed out 
of the door is great.

Its funny seeing comments like this where a simple question by 
the OP, turns into a whole and totally useless technical 
discussion. Followed by some comment that comes down to"ignore it 
because everybody cheats" And people here wonder why D has issues 
with popularity. Really! Get out much?

 From my point of view, the comment is insulting and tantamount as 
to calling people like me, who implemented a few of the other 
languages as "cheaters", when its literally basic code that is 
used everywhere ( trust me, i am not some magic programmer, who 
knows C++ out of the back of his hand. I barely scrap by on my 
own with PHP and Ruby ).

If the issue is at D its end. Be its D, Vibe.D or the Code used, 
then fix it but do not insult everybody else ( especially the 
people who wrote normal code ).

As the saying goes: "always clean your own house first, before 
criticizing your neighbor's house".


More information about the Digitalmars-d mailing list