[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [tortoisesvn] r21435 committed - Speed up FindScreenLineForViewLine using binary search

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Sat, 21 May 2011 21:06:17 +0200

On 21.05.2011 20:47, Oto BREZINA wrote:
>
>
> On 2011-05-21 18:10, Oto BREZINA wrote:
>> On 2011-05-21 17:40, Stefan Küng wrote:
>>>
>>> I don't understand how this works. Is there some documentation
>>> available? Because it's definitely *not* a binary search:
>>> http://en.wikipedia.org/wiki/Binary_search_algorithm
>> It is just binary search which does not start at (Count/2)half, but
>> minimal 2**n>=Count/2 thus MSB. And thus optimized for machines using
>> binary code, also bypasses division and rounding issues. Quite common
>> one I think.
>>> Please, if you're using such 'tricks', you have to document them properly.
>> Only 'trick' is that we dont finish at find (==), but 'one' before as we
>> have to find first (not just any) equal or greater
> Do we agree it IS binary search?
> With different start point?

Yes, but please add a comment about using the most significant bit,
starting the search in the middle and bypassing division and rounding
issues.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2743398
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-05-21 21:06:28 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.