Patch 8.1.1439
Problem: Json_encode() is very slow for large results.
Solution: In the growarray use a growth of at least 50%. (Ken Takata,
closes #4461)
Files: src/misc2.c
*** ../vim-8.1.1438/src/misc2.c 2019-05-28 23:08:12.068648696 +0200
--- src/misc2.c 2019-06-01 14:31:53.506164187 +0200
***************
*** 2057,2062 ****
--- 2057,2069 ----
{
if (n < gap->ga_growsize)
n = gap->ga_growsize;
+
+ // A linear growth is very inefficient when the array grows big. This
+ // is a compromise between allocating memory that won't be used and too
+ // many copy operations. A factor of 1.5 seems reasonable.
+ if (n < gap->ga_len / 2)
+ n = gap->ga_len / 2;
+
new_len = gap->ga_itemsize * (gap->ga_len + n);
pp = vim_realloc(gap->ga_data, new_len);
if (pp == NULL)
*** ../vim-8.1.1438/src/version.c 2019-06-01 14:15:49.535433551 +0200
--- src/version.c 2019-06-01 14:33:04.925784267 +0200
***************
*** 769,770 ****
--- 769,772 ----
{ /* Add new patch number below this line */
+ /**/
+ 1439,
/**/
--
Proof techniques #2: Proof by Oddity.
SAMPLE: To prove that horses have an infinite number of legs.
(1) Horses have an even number of legs.
(2) They have two legs in back and fore legs in front.
(3) This makes a total of six legs, which certainly is an odd number of
legs for a horse.
(4) But the only number that is both odd and even is infinity.
(5) Therefore, horses must have an infinite number of legs.
/// 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/201906011236.x51Cajmh015536%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.