[Xapian-tickets] [Xapian] #782: Improve encode_length() performance

Xapian nobody at xapian.org
Sun May 5 19:31:00 BST 2019


#782: Improve encode_length() performance
----------------------------+-------------------------
 Reporter:  Kronuz          |             Owner:  olly
     Type:  enhancement     |            Status:  new
 Priority:  normal          |         Milestone:
Component:  Backend-Remote  |           Version:
 Severity:  minor           |        Resolution:
 Keywords:                  |        Blocked By:
 Blocking:                  |  Operating System:  All
----------------------------+-------------------------

Comment (by olly):

 I realised I had stupidly cut-and-pasted the loop above verbatim into both
 versions.  With the appropriate function called in each case I'm seeing
 ~1400ns vs ~1200ns for the `s +=` version.  Not sure why fixing one
 version changes the timings for the unchanged one substantially though.
 Maybe I should heed those `***WARNING***` messages.

 > Maybe not as dramatic, but still faster. And "optimized" code is clean,
 imvho, nothing eccentric or esoteric; and generated instructions (at least
 for x86_64) promote processor pipelining and easy branch prediction.

 I'm not arguing against optimising this - just trying to make sure we're
 optimising based on valid data.

--
Ticket URL: <https://trac.xapian.org/ticket/782#comment:6>
Xapian <https://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list