On 12/06/2013 16:12, Bram Moolenaar wrote:

Mike Williams wrote:

On 12/06/2013 13:10, Bram Moolenaar wrote:

Patch 7.3.1171
Problem:    Check for digits and ascii letters can be faster.
Solution:   Use a trick with one comparison. (Dominique Pelle)
Files:      src/macros.h

[...]

Unfortunately the functions that need speeding up are isalpha() and
isalnum().  Without those VIM is no faster, even with the above patch.

I know, this was just a first step.

:)

The following patch solves the performance issue by applying the same
technique for isalpha() and isalnum().  It also needs the change to
modifier_len() since this is called a lot from has_loop_cmd():

OK, so without any table.  ASCII_ISALNUM() is then doing three compares,
that's probably still OK.

Any difference wrt the table approach is lost at the noise level in the profile. Both approaches are a lot faster than calling isalpha() or isalnum() on Windows. I can't comment on non-Windows platforms. If need be make the new ASCII_ISALPHA() and ASCII_ALNUM() conditional on win32 platform since a benefit has only really been shown there so far.

Mike
--
Yoghurt the Great, Yoghurt the All Powerful? No just plain yoghurt.

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui