On Sat, 2013-02-09 at 13:00 +0100, ~suv wrote:
On 2013-02-09 07:24 +0100, Tavmjong Bah wrote:
I am surprised that the r12105 check-in has such a big effect. It does add a function determine where to insert a separator. The function is called at start up once per font family (why?). It does include a strcmp() but I can't see that that would be so slow. If this function is causing a slow down at start up then it should also cause a slow down in scrolling the font list where it is also called. I have less than 100 fonts on my system so I can't really test.
Tests measuring launch times are reproducible here: I rebuilt and timed repeated runs of the relevant revisions (r12103-12107, 12111) on my main system (OS X 10.7, both backends) again, with the same results (noticeably slower to launch with revision >= 12105, compared to stable and revision <= 12104).
Opening the font list drop-down the first time, or scrolling the font list later on is more difficult to measure for comparison... - AFAICT in a new document just opened, scrolling the font list once it has been filled (including the previews) is not noticeably slower (comparing r12104 with r12105 and r12111), but I wouldn't know how to precisely time CPU activity if the list is opened for the first time in the current session (since the list doesn't show the full length and no scrollbar the first time it is opened during a session, monitoring CPU activity seems to be the only indicator of internal font-related activities (building/sorting the list, creating the reviews?)).
Sorry if my concerns seem exaggerated: I'm a bit wary of launch times because concerns/complaints about about font-related delays when launching inkscape trunk are still regularly voiced on the irc channel (e.g. reports about 40-60 sec until the document window opens, on linux systems with 1000-2000 fonts installed, are not uncommon - and these are numbers from before the most recent changes to the font list.)
In r12111 I got rid of the construction of a std::map that linked font-family name to an iterator in the GtkTreeModel. It was no longer useful since a map can have only a one to one mapping while a font-family name may now appear twice in the font-family list. This may speed up start up. In r12112 I changed the "tag" used to mark a separator row from "separatoR" to "#". This should speed up start up too but I can't believe it will make that big of a difference.
Tav