Subject: bug#22763: 25.1.50; Feature Request -- A faster method to obtain line number at position.

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 07 Feb 2021 17:07:57 +0100

Lars Ingebrigtsen <[email-masked]> writes:

> I didn't actually discover it before I had finished writing the new
> function, so I think I'll just extend the new function to have the same
> signature, and then remove the simple.el function.

This takes 2.8s in Emacs 27 and 0.3s after the change:

(with-temp-buffer
  (insert-file-contents "~/src/emacs/trunk/src/ChangeLog.11")
  (benchmark-run 1000
    (line-number-at-pos (point-max))))

So that's nice.  `line-number-at-pos' is used all over Emacs, but
probably not in a loop a lot, so it probably doesn't make much
difference, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no