Hi Norbert,
Thanks for finding this out; I commited your patch.
For sure, many more optimizations of this kind can be done,
but it also hampers the readability. It is probably a good idea
to make more heavy use of symbols; of course the tree_label class
already serves this purpose, but is would probably be good to
handle frequently used strings in a similar way,
for instance following the lines suggested by Max.
However, this probably will require quite a lot of work,
if we want to make it clean, systematic and really efficient.
If profiling could detect the places which are most critical,
a few patches of your kind might actually suffice.
There is an even more crucial optimization issue,
which concerns a systematic use of const references.
A long time ago, David Alouche performed some experiences and
noticed a 15% speedup just by treating the basics which
are now in Kernel. Maybe a 30% or 50% overall speedup could
be achieved by using const references in a systematic way.
Again, this has to be done very carefully and systematically,
which requires quite a lot of time (and hampers readability;
C++ is not really nice in this respect).
Best wishes, Joris
On Fri, Jun 12, 2009 at 02:51:31PM +0200, Norbert Nemec wrote:
Hi there,
I just tried to do some profiling of TeXmacs and managed to produce
a small but significant speedup in the startup time: from 2.0 sec
to 1.8 sec (averaged over several runs of "time texmacs -q").
Turns out that quite some time was spent in frequent calls to the
routine implemented as
-------
inline bool is_none (url u) { return u->t == tuple ("none"); }
-------
replacing this by a comparison with a global variable initialized
just once. Attached is a tiny patch that implements this change.
Far more important than this change itself, however, is the general
question that it poses: how many more objects are there in the code
that are initialized from a constant string over and over again?
How much efficiency could we gain from a global symbol table that
is initialized just once?
Greetings,
Norbert
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
_______________________________________________
Texmacs-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/texmacs-dev
_______________________________________________
Texmacs-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/texmacs-dev