pá 28. 12. 2018 v 3:27 odesílatel Thomas Dickey <address@hidden
On Thu, Dec 27, 2018 at 07:09:09PM -0600, Bryan Christ wrote:
> I was testing the performance of pair_content() 2 different ways.
> 1. The very unscientific, observation that "pspg" (a db pager) was
> very slowly horizontally when testing my emulator on F29 but not on Bionic.
> 2. I placed both instances under callgrind which surfaced pair_content() as
> being quite consuming on F29 but not Bionic.
Then that would show the number of calls (as well as some measure of time).
> Since my terminal emulator really has no idea how the caller setup their
> color pair matrix/bindings, the only reliable thing I can do is iterate
> through the enumerated pairs looking for the fg / bg set they specified.
> Albeit, I was already planning to write and interface that allows the
> implementer to supply their own interface equivalent to pair_content() with
> the assumption that the caller has intimate knowledge of the mappings. For
> my own demo program, I did that, and the performance I expected returned.
I see. I had in mind something that would iterate over a few million
calls (enough to get some useful timing on the pair_content logic).
> The observations/differences were noted in both xfce4-terminal and
> gnome-terminal in F29 vs Bionic. A quick peek at both shows that in all
> cases TERM is set to xterm-color256 so I doubt there's a big difference
sure there is: one has twice as many color pairs.
You can see that using infocmp. I did that, and also checked the
curses.h header file to see which features were enabled.
Bionic has the _source_ for ncurses 6.1, but uses ABI 5 (pre-2015).
Offhand, with ABI 6 you'll use more memory but for the same calls,
probably get roughly the same performance. A small benchmark
would prove that one way or the other :-)
The problem with some random program is that there's usually little
care about managing large numbers of color pairs.
pspg uses about 20 color pairs (while menu was not used)
> On Thu, Dec 27, 2018 at 6:44 PM Thomas Dickey <address@hidden> wrote:
> > On Thu, Dec 27, 2018 at 05:30:55PM -0600, Bryan Christ wrote:
> > > I spent quite a bit of time tracing down performance issues on Fedora 29.
> > > It turns out, that for whatever reason, pair_content() is about 7x slower
> > > in the ncurses build that comes with Fedora 29 vs the build included with
> > > Bionic Beaver.
> > In a quick check, it seems that Fedora 29's using ABI 6 (infocmp hints that
> > supports 6.1's extended pairs) while Bionic is still using ABI 5:
> > + no wheel-mouse
> > + limited to 16 colors
> > Is this for the same terminal description? How are you testing
> > pair_content?
> > With ABI 6 (whether or not using 6.1), you can have a lot more color pairs,
> > which may be misleading.
> > fwiw, Debian/testing seems fairly comparable to Fedora29. Ubuntu lags
> > that by a year or two -ymmv
Thomas E. Dickey <address@hidden>
Bug-ncurses mailing list