HNHacker News
TopNewBestAskShowJobs

MalcolmEvershed

20 karma · joined August 11, 2013

submissionscomments
MalcolmEvershed··on Web Framework Benchmarks Round 7
There were a variety of experiments with async and I don't think there has yet been any data to show that it improved performance of this benchmark.

[0] https://github.com/TechEmpower/FrameworkBenchmarks/pull/272#... [1] https://github.com/TechEmpower/FrameworkBenchmarks/issues/31... [2] https://github.com/TechEmpower/FrameworkBenchmarks/pull/339#...

MalcolmEvershed··on Web Framework Benchmarks Round 7
I implemented the threadpool tuning originally first for the ASP.NET tests (https://github.com/TechEmpower/FrameworkBenchmarks/issues/39...) because it improved performance 5-10%. If you've seen data showing that it actually hurts performance, please open an issue or send a pull request (especially for the additional ~60% performance gain). Thanks.
MalcolmEvershed··on Edward C++Hands
No, I'm not implying any of that. I'm just saying that an important step to getting good performance is profiling to determine the cause of poor performance, then deciding whether it makes sense to try to improve performance in the found areas, then executing your decision.

Imagine the alternative if I didn't profile: I'd just declare that C++/whatever is way faster than ASP.NET, and I'd switch to C++ and open myself to a whole world of debugging memory corruption issues whatnot. Instead, because I profiled, I found the areas that could be improved, I wrote the HttpListener code and I can stay on the .NET platform for all of its other benefits. By following this process I have more options than just "C# blows, I gotta throw it out the window for C++".

In reality, I have probably written more useful, shipped, production C/C++ than C#, so I'm also a C++ advocate, but hey, when it makes sense, and for the right reasons, you know?

MalcolmEvershed··on Edward C++Hands
In case anyone is curious what is going on with those ASP.NET TechEmpower benchmarks:

The TechEmpower benchmarks are all about how much overhead you can eliminate. I profiled the CPU-bound ASP.NET TechEmpower benchmarks and most of the time is spent in IIS<->ASP.NET overhead. After I removed IIS and ASP.NET by just using the .NET HttpListener class [0], the result (on my machine) gives Go a run for its money. Hopefully these results will show up in the next Round that TechEmpower runs.

I profiled the .NET TechEmpower tests that access PostgreSQL and MySQL and found that the database drivers had a lot of unnecessary overhead, for example the Oracle .NET MySQL provider does a synchronous ping to the MySQL Server for every connection, even if it's pooled. Plus, it sends an extra 'use database;' command. [1] The PostgreSQL provider also sends extra synchronous commands for every connection. [2]

[0] https://github.com/TechEmpower/FrameworkBenchmarks/tree/mast... [1] https://github.com/TechEmpower/FrameworkBenchmarks/issues/31... [2] https://github.com/TechEmpower/FrameworkBenchmarks/pull/325#...

MalcolmEvershed··on Linux 3.9 introduced a new way of writing socket servers
I believe that quote from [2] is referring to simply calling accept(), but modern socket servers use epoll() (or similar) before accept() which I think still has the problem (because I've run strace on nginx and uwsgi and I'm pretty sure I saw all processes wake-up from epoll()). So I'm thinking that with SO_REUSEPORT, each server process would have a different socket to epoll() on, and the kernel would only wake-up one process on a new connection, thus, solving the thundering herd problem for modern servers.
MalcolmEvershed··on Linux 3.9 introduced a new way of writing socket servers
It seems like this could help solve the thundering herd problem [0][1][2], no?

[0] http://en.wikipedia.org/wiki/Thundering_herd_problem [1] http://stackoverflow.com/questions/15636319/why-is-accept-mu... [2] http://uwsgi-docs.readthedocs.org/en/latest/articles/Seriali...

MalcolmEvershed··on Unfair comparisons
I worked on improving the aspnet (on Windows) results and I committed aspnet-stripped (based on @pdonald's aspnet tests) and HttpListener.

As that committer, I have to ask: Why would you change your career path due to supposed 'abysmal performance' reported on a website?

Keep in mind that the 'abysmal performance' of many of the frameworks can still handle millions of requests per day. Plus, many of the 'slower' frameworks have other development benefits like ease of development, community ecosystem, static type checking, etc.

The reason I replied is because I'm considering jumping from aspnet to a 'slower' framework like django and I'm not basing my decisions solely on the results of this collaborative benchmark where I don't even know if experts have tuned the results, and where I don't know why the results are 'poor'.