[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font
From: |
Pantxo Diribarne |
Subject: |
[Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font |
Date: |
Sat, 11 Apr 2020 09:01:05 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0 |
Follow-up Comment #8, bug #58150 (project octave):
We have a font manager that is supposed to cache already loaded fonts. I had
already noticed that this did not work so well (at least no as I would
expect).
I have added the following printf in order to see when a given font face is
erased from the font cache:
diff -r bc6dae9cbe73 libinterp/corefcn/ft-text-renderer.cc
--- a/libinterp/corefcn/ft-text-renderer.cc Thu Apr 09 15:35:57 2020
-0700
+++ b/libinterp/corefcn/ft-text-renderer.cc Sat Apr 11 14:25:08 2020
+0200
@@ -412,7 +412,8 @@
if (face->generic.data)
{
ft_key *pkey = reinterpret_cast<ft_key *> (face->generic.data);
-
+ printf ("Destroying font %s\n", pkey->first.c_str ());
+
cache.erase (*pkey);
delete pkey;
face->generic.data = nullptr;
Here is what I observe:
octave:1> figure ();
octave:2> axes (); hold on
octave:3> plot (1:10)
octave:4> cla
octave:5> loglog (1:10)
Destroying font *:normal:normal
Destroying font *:normal:normal
... (50+ times) ...
Destroying font *:normal:normal
>From this simple session I can notice the following:
* If I don't add the "hold on" statement, the cache is cleared for each axes
reset/redraw. My conclusion is that for most use case this caching is
inefficient: the cache should persist for at least as long as a figure exists
(ideally it would persist for an Octave session).
* after "hold on", a simple "plot" command seems to use cached fonts but log
plots feed/free the cache 50+ times
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58150>
_______________________________________________
Message posté via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Guillaume, 2020/04/09
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Rik, 2020/04/09
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Dmitri A. Sergatskov, 2020/04/09
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Guillaume, 2020/04/10
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Rik, 2020/04/10
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Rik, 2020/04/10
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Rik, 2020/04/10
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Rik, 2020/04/10
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font,
Pantxo Diribarne <=
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Pantxo Diribarne, 2020/04/11
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Guillaume, 2020/04/11
- [Octave-bug-tracker] [bug #58150] Slow loglog plot with non-default font, Rik, 2020/04/11