<div dir="ltr">wrong version, this is my letest version: <a href="https://paste.ofcode.org/qWsQikdhKiAywgBpKwANFR">https://paste.ofcode.org/qWsQikdhKiAywgBpKwANFR</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 21, 2017 at 3:01 PM, Daniel Kozak <span dir="ltr"><<a href="mailto:kozzi11@gmail.com" target="_blank">kozzi11@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">my version: <a href="https://paste.ofcode.org/RLX7GM6SHh3DjBBHd7wshj" target="_blank">https://paste.ofcode.<wbr>org/RLX7GM6SHh3DjBBHd7wshj</a></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 21, 2017 at 2:50 PM, Sönke Ludwig via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_1427794945227036600HOEnZb"><div class="m_1427794945227036600h5">Am 21.09.2017 um 14:41 schrieb Vadim Lopatin:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thursday, 21 September 2017 at 10:21:17 UTC, Sönke Ludwig wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
     shared static this()<br>
     {<br>
         (...)<br>
     }<br>
</blockquote>
<br>
BTW, I'd recommend using<br>
<br>
    void main()<br>
    {<br>
        (...)<br>
        runApplication();<br>
    }<br>
<br>
instead and dropping the VibeDefaultMain version in the package recipe. The old approach is planned to be faded out slowly, because it requires some special DUB support that would be nice to see gone at some point.<br>
</blockquote>
<br>
Thank you!<br>
Trying to use multithreaded mode.<br>
<br>
Under windows, best Vibe.d results are equal to results of Go server.<br>
Under linux, Vibe.d is still slower even if there are 4 threads listening.<br>
<br>
Results:<br>
<br>
OS       lang:config   req/s    comments<br>
=======  ==========    =======  ==========<br>
Linux    go            53K<br>
Linux    D:default     48K      1 thread<br>
Linux    D:libevent    48K      1 thread<br>
Linux    D:libasync    46.5K    4 threads<br>
<br>
Windows  go            12K<br>
Windows  D:default     12K      4 threads<br>
Windows  D:libevent    12K      4 threads<br>
Windows  D:libasync    7K       4 threads<br>
<br>
Under Linux in default and libevent configurations, I see error messages from 3 of 4 threads - looks like only one thread can process connections.<br>
<br>
Failed to listen on <a href="http://0.0.0.0:3000" rel="noreferrer" target="_blank">0.0.0.0:3000</a><br>
Task terminated with uncaught exception: Failed to listen for incoming HTTP connections on any of the supplied interfaces.<br>
<br>
<br>
</blockquote>
<br></div></div>
Oh, sorry, I forgot the reusePort option, so that multiple sockets can listen on the same port:<br>
<br>
    auto settings = new HTTPServerSettings("<a href="http://0.0.0.0:3000" rel="noreferrer" target="_blank">0.0.0.0:30<wbr>00</a>");<br>
    settings.options |= HTTPServerOption.reusePort;<br>
    listenHTTP(settings, &handleRequest);<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>