{"thread":{"id":"23828","subject":"gitk (or tcl/tk) slow to start?","startedAt":"2010-05-17T10:58:23Z","lastAt":"2010-05-18T07:04:09Z","messageCount":4,"participants":["Eli Barzilay","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"141804","messageId":"19441.8527.606063.296769@winooski.ccs.neu.edu","threadId":"23828","inReplyTo":null,"subject":"gitk (or tcl/tk) slow to start?","fromName":"Eli Barzilay","fromEmail":"eli@barzilay.org","sentAt":"2010-05-17T10:58:23Z","receivedAt":"2010-05-17T10:58:23Z","isPatch":false,"sender":{"key":"eli@barzilay.org","avatar":"https://avatars.githubusercontent.com/u/185905?v=4"},"body":"Every time I run gitk when I didn't use it for a while, it takes a\nlong time to start (more than 30 seconds) with no visible cpu load.  I\ntried to strace it, and the result shows that the time is spent\nstat()ing my whole /usr/lib directory:\n\n  ...\n  stat(\"/usr/lib/libelf-0.131.so\", {st_mode=S_IFREG|0755, st_size=87496, ...}) = 0\n  stat(\"/usr/lib/libungif.so.4\", {st_mode=S_IFREG|0755, st_size=2444, ...}) = 0\n  stat(\"/usr/lib/libtiff.so.3.8.2\", {st_mode=S_IFREG|0755, st_size=360268, ...}) = 0\n  ...\n\nIs this expected?  Anything that can be done to avoid it?\n\n[This is using a new git version (1.7.1), but it's an old OS (Fedora\n7), so maybe tcl/tk is buggy?]\n\n-- \n          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:\n                    http://barzilay.org/                   Maze is Life!\n"},{"id":"141808","messageId":"4BF12DA6.9090709@drmicha.warpmail.net","threadId":"23828","inReplyTo":"19441.8527.606063.296769@winooski.ccs.neu.edu","subject":"Re: gitk (or tcl/tk) slow to start?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-05-17T11:51:02Z","receivedAt":"2010-05-17T11:51:02Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Eli Barzilay venit, vidit, dixit 17.05.2010 12:58:\n> Every time I run gitk when I didn't use it for a while, it takes a\n> long time to start (more than 30 seconds) with no visible cpu load.  I\n> tried to strace it, and the result shows that the time is spent\n> stat()ing my whole /usr/lib directory:\n> \n>   ...\n>   stat(\"/usr/lib/libelf-0.131.so\", {st_mode=S_IFREG|0755, st_size=87496, ...}) = 0\n>   stat(\"/usr/lib/libungif.so.4\", {st_mode=S_IFREG|0755, st_size=2444, ...}) = 0\n>   stat(\"/usr/lib/libtiff.so.3.8.2\", {st_mode=S_IFREG|0755, st_size=360268, ...}) = 0\n>   ...\n> \n> Is this expected?  Anything that can be done to avoid it?\n\nI don't expect stat'ing /usr/lib to take 30s. How large is it (file size\nand count)?\n\n> [This is using a new git version (1.7.1), but it's an old OS (Fedora\n> 7), so maybe tcl/tk is buggy?]\n> \n\nver += 6 - epsilon ; /* :) */\n\nMichael\n"},{"id":"141850","messageId":"19441.64268.762782.215315@winooski.ccs.neu.edu","threadId":"23828","inReplyTo":"4BF12DA6.9090709@drmicha.warpmail.net","subject":"Re: gitk (or tcl/tk) slow to start?","fromName":"Eli Barzilay","fromEmail":"eli@barzilay.org","sentAt":"2010-05-18T02:27:24Z","receivedAt":"2010-05-18T02:27:24Z","isPatch":false,"sender":{"key":"eli@barzilay.org","avatar":"https://avatars.githubusercontent.com/u/185905?v=4"},"body":"On May 17, Michael J Gruber wrote:\n> Eli Barzilay venit, vidit, dixit 17.05.2010 12:58:\n> > Every time I run gitk when I didn't use it for a while, it takes a\n> > long time to start (more than 30 seconds) with no visible cpu load.  I\n> > tried to strace it, and the result shows that the time is spent\n> > stat()ing my whole /usr/lib directory:\n> > \n> >   ...\n> >   stat(\"/usr/lib/libelf-0.131.so\", {st_mode=S_IFREG|0755, st_size=87496, ...}) = 0\n> >   stat(\"/usr/lib/libungif.so.4\", {st_mode=S_IFREG|0755, st_size=2444, ...}) = 0\n> >   stat(\"/usr/lib/libtiff.so.3.8.2\", {st_mode=S_IFREG|0755, st_size=360268, ...}) = 0\n> >   ...\n> > \n> > Is this expected?  Anything that can be done to avoid it?\n> \n> I don't expect stat'ing /usr/lib to take 30s. How large is it (file\n> size and count)?\n\nI've done some more counting -- the most number of system calls (as\ntracked by strace) are 2968 reads, 4582 lstats, and 6520 stats.  And\nit looks like it's recursively scanning /lib, /usr/lib, and /usr/share\nfor all *.tcl files.  stracing `wish' shows 11000 l/stats -- so I\nguess that the problem is there and not in gitk.  Trying wish on a\nfedora 12 machine, I see only ~350 {,f,l}stat64 calls, and gitk starts\nas fast as I'd expect it to.\n\nOh well, I was hoping that someone knows some bit that needs flipping\nor updating to get it to work faster -- I guess it's one more reason\nto finally upgrade the F7 machine...\n\n-- \n          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:\n                    http://barzilay.org/                   Maze is Life!\n"},{"id":"141852","messageId":"4BF23BE9.7010401@drmicha.warpmail.net","threadId":"23828","inReplyTo":"19441.64268.762782.215315@winooski.ccs.neu.edu","subject":"Re: gitk (or tcl/tk) slow to start?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-05-18T07:04:09Z","receivedAt":"2010-05-18T07:04:09Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Eli Barzilay venit, vidit, dixit 18.05.2010 04:27:\n> On May 17, Michael J Gruber wrote:\n>> Eli Barzilay venit, vidit, dixit 17.05.2010 12:58:\n>>> Every time I run gitk when I didn't use it for a while, it takes a\n>>> long time to start (more than 30 seconds) with no visible cpu load.  I\n>>> tried to strace it, and the result shows that the time is spent\n>>> stat()ing my whole /usr/lib directory:\n>>>\n>>>   ...\n>>>   stat(\"/usr/lib/libelf-0.131.so\", {st_mode=S_IFREG|0755, st_size=87496, ...}) = 0\n>>>   stat(\"/usr/lib/libungif.so.4\", {st_mode=S_IFREG|0755, st_size=2444, ...}) = 0\n>>>   stat(\"/usr/lib/libtiff.so.3.8.2\", {st_mode=S_IFREG|0755, st_size=360268, ...}) = 0\n>>>   ...\n>>>\n>>> Is this expected?  Anything that can be done to avoid it?\n>>\n>> I don't expect stat'ing /usr/lib to take 30s. How large is it (file\n>> size and count)?\n> \n> I've done some more counting -- the most number of system calls (as\n> tracked by strace) are 2968 reads, 4582 lstats, and 6520 stats.  And\n> it looks like it's recursively scanning /lib, /usr/lib, and /usr/share\n> for all *.tcl files.  stracing `wish' shows 11000 l/stats -- so I\n> guess that the problem is there and not in gitk.  Trying wish on a\n> fedora 12 machine, I see only ~350 {,f,l}stat64 calls, and gitk starts\n> as fast as I'd expect it to.\n> \n> Oh well, I was hoping that someone knows some bit that needs flipping\n> or updating to get it to work faster -- I guess it's one more reason\n> to finally upgrade the F7 machine...\n> \n\nI guess that was truly wish-ful thinking :)\n\n[You can try and recompile an F12 wish.srpm on F7, of course.]\n\nSorry,\nMichael\n"}]}