Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Be aware of splice

by tilly (Archbishop)
on May 03, 2004 at 18:23 UTC ( #350106=note: print w/ replies, xml ) Need Help??


in reply to Be aware of splice

This example illustrates an additional point about algorithmic efficiency.

BrowserUk had initially thought that the algorithm wasn't quadratic because it didn't look quadratic in runs of 10, 100, and 1000 elements. But it did look quadratic when he tested 10_000 and 100_000.

The reason is that the quadratic piece all consists of copying pointers in C, which is very fast. You do a lot of it, so it doesn't scale, but for small sample sizes the eventual performance bottleneck is invisible. And then once the performance bottleneck becomes visible, it doesn't take long until it dominates.

Which is a basic fact about scalability. When you are dealing with small samples, you care much more about the efficiency of your individual operations. Which is relatively easy to benchmark. When you deal with large samples, you care about the scaling pattern. A very cheap operation that is at a spot which scales poorly will eventually be a bottleneck. Understanding the latter kind of problem is fairly hard for most people, and problems of this nature constantly tend to surprise people who didn't factor it in in a simple extrapolation.

(Important note: scaling bottlenecks don't just happen in code. If you spend most of your life in meetings, well you've just seen what a scaling bottleneck in an organization of humans looks like!)


Comment on Re: Be aware of splice

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://350106]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2014-07-12 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (241 votes), past polls