[petsc-users] matsetvaluesblocked4_

Jed Brown jed at jedbrown.org
Thu May 28 09:21:13 CDT 2020


Mark Adams <mfadams at lbl.gov> writes:

>>
>>
>> >
>> > *if (rp[low] == col) high = low+1;else *       if (rp[t] > col) high = t;
>> >         else low = t;
>>
>> Replacing a single comparison per bsearch iteration with two doesn't
>> seem like a good choice to me.
>>
>>
> It forces the bisection search and the linear search to terminate in one
> iteration.

I care about the impact when inputs aren't sorted.  If the fast-path
doesn't take effect, you've doubled the branching and (although it would
need testing) I'm concerned about the perf impact.  That is, I'm willing
to pay one extra branch per inserted entry, but not an extra branch per
iteration of the search.


More information about the petsc-users mailing list