texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Speedup in startup time


From: Gubinelli Massimiliano
Subject: Re: [Texmacs-dev] Speedup in startup time
Date: Fri, 12 Jun 2009 15:06:03 +0200

Hi,


On 12 juin 09, at 14:51, 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?


I've noticed that in TeXmacs code sometimes constant strings are used as atoms ( or symbols ) without having a special handling and thus a bit inefficiently as you also noticed. It would be nice to do the following experiment: implement a symbol hashset where you register common strings. A new constructor for symbol strings is then added which checks if the string is already present in the hashset and eventually returns this instance. Then string comparison can be implemented as a two steps procedure: 1) pointer comparison and when this fails 2) actual string comparison. This would add a small overhead over the plain string comparison but maybe with added benefits to be quantified by experimentation (since I have no idea about the quantity of code which uses strings as atoms).

best,
max

Greetings,
Norbert
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
<url_none>_______________________________________________
Texmacs-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/texmacs-dev





reply via email to

[Prev in Thread] Current Thread [Next in Thread]