Problem: Json_encode() is very slow for large results.
Solution: In the growarray use a growth of at least 50%. (Ken Takata,
closes #4461)
{
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)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1439,
/**/
1438,
/**/