Re:High-performance .NET by example: Filtering bot traffic
by NKCSS on Monday April 24, 2017 @09:32AM
(#14184133)
I'd probably store cached results for Dictinary<int, HashSet<string>> allowed, notAllowed; where int == length of the user agent. This should probably be blazing fast as well instead of keep doing those lookups.
[ Parent
| on HN ]
Re:High-performance .NET by example: Filtering bot traffic
by alexandrnikitin on Monday April 24, 2017 @09:46AM
(#14184233)
I doubt that exactly that will work. There are tens of thousands of different UAs (maybe 100K). Perhaps some kind of tiny (few CPU cache lines) cache for most popular UAs could help. But again: measure, measure, measure :)
Re:High-performance .NET by example: Filtering bot traffic
by NKCSS on Monday April 24, 2017 @10:18AM
(#14184484)
Publish your test set and I can look at it :)
Re:High-performance .NET by example: Filtering bot traffic
by alexandrnikitin on Monday April 24, 2017 @12:19PM
(#14185519)
I'm afraid I can't do that because of proprietary data. I think I can come up with analogous tests using open data. I'll let you know ;)
Re:High-performance .NET by example: Filtering bot traffic
by andrewgrowles on Monday April 24, 2017 @10:07AM
(#14184394)
A FST seems like a good fit for this problem. I believe it will be much more compact than the Aho-Corasick algorithm trie structure. Depends on the size of the dictionary.
Re:High-performance .NET by example: Filtering bot traffic
by alexandrnikitin on Monday April 24, 2017 @10:16AM
(#14184473)
I have that feeling too. But I found it harder to implement, especially with fallback failure references.
Re:High-performance .NET by example: Filtering bot traffic
by andrewgrowles on Monday April 24, 2017 @10:26AM
(#14184552)
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
[3] https://www.slideshare.net/lucenerevolution/text-tagging-wit...
Re:High-performance .NET by example: Filtering bot traffic
by animal531 on Tuesday April 25, 2017 @07:56AM
(#14192625)
One can find Lucene.NET here:
https://lucenenet.apache.org/
Re:High-performance .NET by example: Filtering bot traffic
by alexandrnikitin on Monday April 24, 2017 @12:33PM
(#14185652)
Awesome! The talk is great! It would be really interesting to try it. Thanks for sharing.