I think it's more that memory is getting slower relative to CPU, as we all know, so complicated data structures that involve lots of random access to memory aren't so efficient anymore vs linear scans through memory that can benefit from cache. It's still engineering, just the tradeoffs have shifted.
Searching 20 GB/sec: Systems Engineering Before Algorithms
11–20 of 87 posts
Re: Searching 20 GB/sec: Systems Engineering Before Algorithms
#12Re: Searching 20 GB/sec: Systems Engineering Before Algorithms
#13A better title would be, "How we determined when to use brute force."
Re: Searching 20 GB/sec: Systems Engineering Before Algorithms
#14Also really tiny loops; what slows them down is having to make lots of conditional branches/calls.
This related article could be interesting for those who are curious to know how fast plain C (not even inline Asm) can do string searches: http://www.codeproject.com/Articles/250566/Fastest-strstr-li...
I do wish Intel/AMD would make the REP SCASB/CMPSB instructions faster, since they could enable even faster and efficient string searches limited only by memory bandwidth. (Or they could add a new instruction for memmem-like functionality, although I'd prefer the former.)
Re: Searching 20 GB/sec: Systems Engineering Before Algorithms
#15They're not using any fancy algorithms...except when they implement a customized version of Boyer-Moore for better string searching in a critical section of their algorithm. Not to mention all the fancy algorithms optimizing their brute-force code underneath their immediately visible program. A better title would be, "How we determined when to use brute force."
Re: Searching 20 GB/sec: Systems Engineering Before Algorithms
#16Re: Searching 20 GB/sec: Systems Engineering Before Algorithms
#17This comes up in my work modestly frequently, generally with a slightly different scenario for the tradeoff between "complicated and considered" versus "cheap and dirty but gets the job done." e.g. We could spend 3 weeks using feature vectors and backtesting against prior data to figure out what signals accounts which are likely to churn send (for the purpose of proactively identifying them and attempting to derisk t…
I get the feeling this is more "era-defining" than that... What hit me was the "Processors are so fast now we can Brute force grep over 100GB in a second". We are entering a world where 20TB on a magnetic disk is viable, but randomly accessing that data could take months to extract. So how we store data on disks will become vitally important to how we use the data - not unlike tape drives of pre-1980s era where rewin…
Today, we're keeping everything on SSD -- twice, in fact, to maintain a hot spare for each server. SSD prices have fallen to the point where, even renting from Amazon, we can make the cost model work; and SSD is a great crutch as we tune our storage layer. But spinning disk will be a lot cheaper.
As for Java: we've been pretty surprised ourselves. Going in, we expected to need a lot more "native" (C) code. As it turned out, currently the only non-Java code we're using is the LZ4 library, and even there we only recently moved to the non-Java implementation. We do soon expect to move a few more bits of code to C, such as the core text-search loop. But based on the performance we've been getting in pure Java, we don't anticipate any need to move more than a fraction of 1% of our overall code base.
We do have some code that lives in a sort of middle ground -- Java code written like it was in C. Our database buffers live in a set of 2GB byte arrays, soon to be replaced by native memory blocks. We do our own (very simple) memory allocation within that, and use a sprinkling of Unsafe operations to access it. This gets us closer to C performance (not all the way there), without any of the hassles of bridging across languages. This part is still well under 1% of our overall codebase.
Re: Searching 20 GB/sec: Systems Engineering Before Algorithms
#18They're not using any fancy algorithms...except when they implement a customized version of Boyer-Moore for better string searching in a critical section of their algorithm. Not to mention all the fancy algorithms optimizing their brute-force code underneath their immediately visible program. A better title would be, "How we determined when to use brute force."
Say what you will, but while Boyer-Moore can be tricky to implement, it's not exactly a fancy algorithm.
Re: Searching 20 GB/sec: Systems Engineering Before Algorithms
#19http://channel9.msdn.com/Events/Build/2014/2-661
The basic take-away is to always prefer std::vector and boost::flat_set/flat_map unless you have evidence to the contrary.
Re: Searching 20 GB/sec: Systems Engineering Before Algorithms
#20When did "simple" become such a dirty word? Simple isn't synonymous with lazy.