Olaf Dabrunz wrote:
> This needed more time and work on more realistic tests, and to create a
> fix that addresses all issues. Sorry for the delay.
>
> Summary:
>
> - Bug: locks can result in false error reports or missing error
> reports when the locks are not interpreted in the same way by all
> vim functions and commands.
>
> When this is fixed, locks
>
> - can reliably be used to find mistakes
>
> - do not terminate production runs (or test runs) because of
> unexpected false positives.
>
> - Bug: on an attempt to change a locked item, extend() is left with
> an error and all previous changes are kept (exit-on-error).
>
> - Bug: when the target dict is locked, extend() reports false errors
> for 'extend(d, {})' and 'extend({"a": 1}, {"a": 2}, "keep")'.
>
> - New, less artificial tests show that a lock check loop adds less
> overhead than suggested by previous tests, esp. for common use
> cases.
>
> For the more common use cases, a separate lock test loop adds an
> overhead of
>
> avg.: 17% stddev: ± 16, max. 40%.
>
> Across the whole range of use cases, the tests show an overhead of
>
> avg.: 34% stddev: ± 27, max. 100%.
>
> These tests are still somewhat artificial. The overhead shrinks
> beyond these values when larger item values (e.g. real-life
> strings) are used.
>
> - Fix: all above bugs are fixed for extend() by using a lock check
> loop that is only used when the target dict has locks set.
>
> This implements all-or-nothing behavior at near-zero cost when no
> locks are used on the target dict.
>
> When locks are used on the target dict, the slowdown is as shown
> in above tests.
>
> - Open issue: are lock check loops needed in other situations (e.g.
> for lists), and should a similar lock count optimization be used?
This is a long message... Your reasoning makes sense. Anybody else has
a problem with the proposed solution?
dv_ilocked is not an obvious name, perhaps dv_has_locks?
The loop to check for locks is very similar to the loop doing the work.
Consider using the same loop and run it twice, once to check and once to
do the work. Avoids that later only one of the two loops is modified.
--
hundred-and-one symptoms of being an internet addict:
142. You dream about creating the world's greatest web site.
/// 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.