Live data from Hacker News

High-performance .NET by example: Filtering bot traffic

alexandrnikitin.github.io

51–54 of 54 posts

Re: High-performance .NET by example: Filtering bot traffic

#51
post #33

I did something similar with nginx, the data file from 51degrees and some lua code; each instance only handles 10-20k requests/sec so no clever optimization was needed.

Would you mind posting the Lua code?

Hi,

I've made a gist[0]; feel free to get in touch via GH if you'd like to discuss it further.

[0] - https://gist.github.com/marklr/ae0c2f1eb61855d13cde6cef6bf63...

Re: High-performance .NET by example: Filtering bot traffic

#52

Earlier quoted context omitted.

I have that feeling too. But I found it harder to implement, especially with fallback failure references.

I'd look for a library and not write one from scratch. Lucene [1] and OpenFST [2] are great implementations. I haven't used C#, so I don't know if bindings exist or not. Also you may find this talk useful [3] (Particularly slide 11). Great write up by the way. Really thorough on the benchmarking! [1] https://lucene.apache.org/core/4_1_0/core/org/apache/lucene/... [2] http://www.openfst.org/twiki/bin/view/FST/WebHome…

One can find Lucene.NET here: https://lucenenet.apache.org/

Re: High-performance .NET by example: Filtering bot traffic

#53
post #48

Earlier quoted context omitted.

That sounds more like a personal attack than a constructive response to the topic. I only brought up large (old) codebases to put into context the kind of maintainability issues I am discussing, and why my perspective is what it is.

It's not a personal attack because I don't actually know anything about you, and I'm not claiming to. I'm making that statement in regard to your two posts up the chain. They are statements that don't reveal any solid, usable points other than to say "simpler code is easier to understand, sometimes performance doesn't matter as much" but in such a strong form as to suggest that the advice plays out a lot in the real…

> ..as to suggest that the advice plays out a lot in the real world. It doesn't.

what makes you say that?

Re: High-performance .NET by example: Filtering bot traffic

#54
post #13

Excellent post showing how to correctly improve code w.r.t. performance using the scientific method: hypothesis, measuring the baseline, change, measuring effect with real tools, real code. Thanks for sharing!

I also found it an interesting post in that it kind of inadvertently proves that for most situations you shouldn't optimise to this extent. Meaning, yes, the OP got impressive performance improvements but the code is also completely unreadable and utilises unsafe code sections which could expose you to security problems/memory leaks/memory corruption. Not to mention they've recreated and will need to maintain an in-h…

> Plus programmers are expensive. Hardware is cheap.

This is entirely a matter of scale. 1 dev can make faster software that runs on thousands of machines with far more ROI than the hours they spent. This is common in several industries.

Post reply on HN