tag:blogger.com,1999:blog-5694203337413075366.post3069410352814440987..comments2021-12-19T11:56:12.305-08:00Comments on Programmers’ Patch: Find the greatest value in a list less than a valuedesmondhttp://www.blogger.com/profile/01722159590093138289noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5694203337413075366.post-90257306643388258052014-10-31T17:19:07.473-07:002014-10-31T17:19:07.473-07:00binsearch ist absolut der schnellste...
But the c...binsearch ist absolut der schnellste...<br /><br />But the code above is not pure binary search, so there is actually no routine I know to compare it with.<br />WIth perl you have the overhead of converting the script into executable code, reading the arguments (off disk?) and you are also at the mercy of whoever wrote the binarysearch routine. Hardware doesn't have to "know anything" about big O it just executes instructions, and the fastest instructions will work the fastest. <br />You have to compare like with like rigorously and I don't see from your description that you've done that.desmondhttps://www.blogger.com/profile/01722159590093138289noreply@blogger.comtag:blogger.com,1999:blog-5694203337413075366.post-859307064455570652014-10-31T07:04:09.232-07:002014-10-31T07:04:09.232-07:00Are you sure, that binsearch ist fastest?
Had a s...Are you sure, that binsearch ist fastest?<br /><br />Had a similar problem, where I benchmarked other solutions against binsearch O(log N), grep O(N) and sequential search O(N/2) in Perl. Binsearch was significantly slower than the other two. Actual implementations are hardware friendly or not, but hardware knows nothing about "big O". <br />wollmershttps://www.blogger.com/profile/18113362149289124869noreply@blogger.com