On Thu, Jun 11 2015, Wolfgang Jenkner wrote: > The loop could be improved a bit by doing pointer arithmetic like in > DEC_POS I wondered whether such a change (to avoid unnecessary buffer gap considerations while in the middle of a multibyte character) would actually make a measurable difference, so, silly as that may be, I wrote a simple benchmark for byte-to-position, using the tutorials as data samples, and passed the results to ministat(1)[*], please see the attached btp-ministat.el and ministat.sh for details. [*] https://www.freebsd.org/cgi/man.cgi?query=ministat&sektion=1&manpath=FreeBSD+10.1-RELEASE The result is that ministat reports statistical differences for several of the tutorials (but not generally for the same languages at each run, system load apparently generating too much statistical noise) and I find that the version with the DEC_POS like loop is _always_ faster in those cases (judging from the average values or just by taking a quick look at the histograms). So, while this is not really very important, it seems that it would be safe to use the following patch with the improved loop instead: