Yasuhiro Matsumoto wrote:

> When using map() for the list, gettext function is called for each items.
> For example, vim doesn't handle dynamic gettext, it become faster than using 
> dynamic gettext.
> 
> ---
> let n = 1000000
> let l = []
> for i in range(n) | let l += [localtime() % 10] | endfor
> 
> let t = reltime()
> call map(l, 'v:val + 1') 
> echo reltimestr(reltime(t))
> ---
> 
> For example, this script mark 0.721670 on latest version.
> After applying below's patch, it mark 0.481578.

Thanks for looking into this.  Perhaps we can go one step further: Only
translate the message when it is actually used.  This requires checking
the methods can be consistently called with an untranslated message.
I haven't verified that is the case.  I suspect it will be so.


-- 
ARTHUR:       You are indeed brave Sir knight, but the fight is mine.
BLACK KNIGHT: Had enough?
ARTHUR:       You stupid bastard.  You havn't got any arms left.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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/d/optout.

Raspunde prin e-mail lui