From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Slowdown around 5.0.5-dev-0
Date: Wed, 14 Oct 2015 09:25:36 -0700 [thread overview]
Message-ID: <151014092536.ZM32511@torch.brasslantern.com> (raw)
In-Reply-To: <CAKc7PVC4rcOD-Os9mgGf2JR4yY0CeG4m1kyPQ3gp67P_-xFDWg@mail.gmail.com>
In-Reply-To: <20151014142722.282d0c5a@pwslap01u.europe.root.pri>
On Oct 14, 8:50am, Sebastian Gniazdowski wrote:
}
} With this patch the list is instant fast.
NEWHEAPS() is O(1) where pushheap() is O(N) where N is the number of
arenas already in the heap. So it's not suprising that it's faster
in the specific case you're trying (lots of data in the heap for a
relatively long time) -- the question is would it slow down in the
more normal use case of a mostly-empty heap and a lot of function
calls, because the one operation done by NEWHEAPS() is heavier than
any one of the N operations in pushheap().
On the other hand for interactive use the difference in the small-memory
case is probably never going to be noticed.
} What's interesting is lower RES for the new patch. It's like with the
} new patch RES can easier go down after peak.
With pushheap() the code tries to maximally use available space in the
already allocated heap arenas; with NEWHEAPS() that available space is
ignored and we create all new arenas. It's possible that allows (or
unintentionally forces) the system malloc() to clump new allocations
together better so that they can be released back to the system sooner.
A helpful side-effect if so, but I wouldn't count on it being true for
all malloc libraries.
On Oct 14, 2:27pm, Peter Stephenson wrote:
}
} I'd suggest a quick finger test with the completion system to see if
} anything is obviously worse --- if anything is going to exercise large
} function stacks with small-to-medium size functions, it's that.
Actually the completion system is the place it's most likely to entirely
break down -- completion already uses NEWHEAPS() to get its own heap, and
then frequently employs SWITCHHEAPS() to be able to pass values back on
the regular heap. If we're also swapping the regular heap around with
NEWHEAPS() it's possible things might get very confused, or that an entire
list of heaps might be leaked.
However, I did just run the Test/Y* tests with valgrind and they all passed
and reported no leaks. (I did get:
==32081== Warning: invalid file descriptor -1 in syscall close()
==32081== Warning: invalid file descriptor -1 in syscall close()
from both Y01 and Y02 but curiously not Y03.)
next prev parent reply other threads:[~2015-10-14 16:25 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-10 10:54 Sebastian Gniazdowski
2015-10-10 17:58 ` Bart Schaefer
2015-10-10 18:11 ` Sebastian Gniazdowski
2015-10-10 18:32 ` Sebastian Gniazdowski
2015-10-11 0:06 ` Bart Schaefer
2015-10-11 6:20 ` Bart Schaefer
2015-10-11 8:39 ` Sebastian Gniazdowski
2015-10-11 16:17 ` Bart Schaefer
2015-10-11 16:48 ` Sebastian Gniazdowski
2015-10-11 17:31 ` Bart Schaefer
2015-10-11 18:05 ` Sebastian Gniazdowski
2015-10-11 21:22 ` Bart Schaefer
2015-10-12 8:21 ` Sebastian Gniazdowski
2015-10-12 14:01 ` Bart Schaefer
2015-10-12 16:50 ` Sebastian Gniazdowski
2015-10-13 0:33 ` Bart Schaefer
2015-10-13 8:21 ` Sebastian Gniazdowski
2015-10-13 15:52 ` Bart Schaefer
2015-10-14 6:50 ` Sebastian Gniazdowski
2015-10-14 13:27 ` Peter Stephenson
2015-10-14 16:25 ` Bart Schaefer [this message]
2015-10-14 16:50 ` Bart Schaefer
2015-10-15 4:32 ` Bart Schaefer
2015-10-15 13:03 ` Sebastian Gniazdowski
2015-10-16 0:35 ` Bart Schaefer
2015-10-17 9:12 ` Sebastian Gniazdowski
2015-10-17 9:24 ` Sebastian Gniazdowski
2015-10-18 16:19 ` Bart Schaefer
2015-10-18 20:40 ` Sebastian Gniazdowski
2015-10-18 21:07 ` Bart Schaefer
2015-10-18 21:31 ` Sebastian Gniazdowski
2015-10-19 17:21 ` Bart Schaefer
2015-10-22 12:49 ` Sebastian Gniazdowski
2015-10-22 15:00 ` Bart Schaefer
2015-10-22 16:28 ` Sebastian Gniazdowski
2015-10-22 16:33 ` Sebastian Gniazdowski
2015-10-23 15:40 ` Sebastian Gniazdowski
2015-10-23 15:57 ` Sebastian Gniazdowski
2015-10-23 19:26 ` Bart Schaefer
2015-10-23 23:50 ` Bart Schaefer
2015-10-24 6:09 ` Sebastian Gniazdowski
2015-10-24 7:37 ` Sebastian Gniazdowski
2015-10-24 8:04 ` Sebastian Gniazdowski
2015-10-24 19:39 ` Bart Schaefer
2015-10-25 7:35 ` Sebastian Gniazdowski
2015-10-25 17:23 ` Bart Schaefer
2015-10-25 20:56 ` Sebastian Gniazdowski
2015-10-26 0:49 ` Bart Schaefer
2015-10-26 7:41 ` Sebastian Gniazdowski
2015-10-26 7:47 ` Sebastian Gniazdowski
2015-10-24 6:27 ` Sebastian Gniazdowski
2015-10-24 10:54 ` Sebastian Gniazdowski
2015-10-24 11:25 ` Sebastian Gniazdowski
2015-10-24 16:31 ` Bart Schaefer
2015-10-24 16:41 ` Bart Schaefer
2015-10-23 6:32 ` Sebastian Gniazdowski
2015-10-16 0:37 ` Bart Schaefer
2015-10-13 13:07 ` Sebastian Gniazdowski
2015-10-13 13:31 ` Sebastian Gniazdowski
2015-10-12 12:05 ` Sebastian Gniazdowski
2015-10-12 15:13 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=151014092536.ZM32511@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).