<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-5400308.post5389485403383060173..comments</id><updated>2007-05-07T04:53:14.874-04:00</updated><title type='text'>Comments on McEs, A Hacker Life: Avoiding extra work</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mces.blogspot.com/feeds/5389485403383060173/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html'/><author><name>behdad</name><uri>http://www.blogger.com/profile/15683613908300939375</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5400308.post-3925377070348855312</id><published>2007-05-07T04:53:00.000-04:00</published><updated>2007-05-07T04:53:00.000-04:00</updated><title type='text'>Hi,I've downloaded pango to see if I understood wh...</title><content type='html'>Hi,&lt;BR/&gt;&lt;BR/&gt;I've downloaded pango to see if I understood what was going on.  This may not be *the* big bottle neck, but a cumulative width stored in "state" definitely lends efficiency. &lt;BR/&gt;&lt;BR/&gt;For what your doing there you don't really  even care about individual character width (of course, I might have missed something).  &lt;BR/&gt;&lt;BR/&gt;Anyway, I guess if you don't care about it I'll submit a patch for this.&lt;BR/&gt;&lt;BR/&gt;Pat.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/3925377070348855312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/3925377070348855312'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178527980000#c3925377070348855312' title=''/><author><name>Patrick</name><uri>http://www.blogger.com/profile/16825472977710666060</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-3022796267826490632</id><published>2007-05-05T20:43:00.000-04:00</published><updated>2007-05-05T20:43:00.000-04:00</updated><title type='text'>Of course I meantstart_index = (int)(N * (float)li...</title><content type='html'>Of course I meant&lt;BR/&gt;&lt;BR/&gt;start_index = (int)(N * (float)line_width/state-&gt;log_widths[N-1]);</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/3022796267826490632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/3022796267826490632'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178412180000#c3022796267826490632' title=''/><author><name>Patrick</name><uri>http://www.blogger.com/profile/16825472977710666060</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-2712196128075180884</id><published>2007-05-05T20:41:00.000-04:00</published><updated>2007-05-05T20:41:00.000-04:00</updated><title type='text'>I guess I thought that state-&gt;log_widths[] is popu...</title><content type='html'>I guess I thought that state-&gt;log_widths[] is populated with the width of each character.  If it was instead populated with the cumulative width (i.e.  state-&gt;log_widths[n] = state-&gt;log_widths[n-1] + char_width[n]) then you *might* be able to very quickly find a good starting point.  For example:&lt;BR/&gt;&lt;BR/&gt;start_index = (int)(N * (float)state-&gt;log_widths[N-1]/line_width);&lt;BR/&gt;&lt;BR/&gt;If state-&gt;log_widths[start_index] &lt; line_width ) {&lt;BR/&gt;  /* something */&lt;BR/&gt;} else {&lt;BR/&gt;  /* something else */&lt;BR/&gt;}&lt;BR/&gt;&lt;BR/&gt;Or something.  &lt;BR/&gt;&lt;BR/&gt;Or maybe a straight binary search on cumulative width would be quite fast.  Or maybe it's just a dumb thought...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/2712196128075180884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/2712196128075180884'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178412060000#c2712196128075180884' title=''/><author><name>Patrick</name><uri>http://www.blogger.com/profile/16825472977710666060</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-5438526592285086185</id><published>2007-05-05T14:10:00.000-04:00</published><updated>2007-05-05T14:10:00.000-04:00</updated><title type='text'>What's the point of using binary search if you can...</title><content type='html'>What's the point of using binary search if you can't get faster than linear?  I have to populate the array first (commulative or not), and then find where to break.  What you suggest neither makes the algorithm asymptotically faster, not any measured speedup.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/5438526592285086185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/5438526592285086185'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178388600000#c5438526592285086185' title=''/><author><name>behdad</name><uri>http://www.blogger.com/profile/15683613908300939375</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='04900605915708655800'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-7182234722211436747</id><published>2007-05-05T00:49:00.000-04:00</published><updated>2007-05-05T00:49:00.000-04:00</updated><title type='text'>I don't get it why binary search won't work with c...</title><content type='html'>I don't get it why binary search won't work with commulative width. It still has to end somewhere in the middle, be it evenly spread or not. At least you reach the right neighborhood much faster. With binary search, you still need to test for breakability or not at every binary point.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/7182234722211436747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/7182234722211436747'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178340540000#c7182234722211436747' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-5425992106689739795</id><published>2007-05-04T13:28:00.000-04:00</published><updated>2007-05-04T13:28:00.000-04:00</updated><title type='text'>Is state-&gt;log_widths[] an array of the width of ea...</title><content type='html'>Is state-&gt;log_widths[] an array of the width of each character?  If so, have you thought about storing the cumulative width   instead of the individual width? I don't know if that makes sense but then you could do binary searches or (possibly) even faster searches based on heuristics.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/5425992106689739795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/5425992106689739795'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178299680000#c5425992106689739795' title=''/><author><name>Patrick</name><uri>http://www.blogger.com/profile/16825472977710666060</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-7289451636438799835</id><published>2007-05-04T12:55:00.000-04:00</published><updated>2007-05-04T12:55:00.000-04:00</updated><title type='text'>Very interesting!, fixing this bug could lead to m...</title><content type='html'>Very interesting!, fixing this bug could lead to me using gedit instead of gvim. Thanks.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/7289451636438799835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/7289451636438799835'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178297700000#c7289451636438799835' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-6405701838885581839</id><published>2007-05-04T08:16:00.000-04:00</published><updated>2007-05-04T08:16:00.000-04:00</updated><title type='text'>You have to compute the commulative width of the c...</title><content type='html'>You have to compute the commulative width of the characters, so bisecting doesn't help.  Also not any position is suitable for a break.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/6405701838885581839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/6405701838885581839'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178280960000#c6405701838885581839' title=''/><author><name>behdad</name><uri>http://www.blogger.com/profile/15683613908300939375</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='04900605915708655800'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-6482829026264533926</id><published>2007-05-04T07:54:00.000-04:00</published><updated>2007-05-04T07:54:00.000-04:00</updated><title type='text'>What the Fxxx? Isn't it a typical bisect searching...</title><content type='html'>What the Fxxx? Isn't it a typical bisect searching problem? Why do you have to search char by char? Did I miss something here?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/6482829026264533926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/6482829026264533926'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178279640000#c6482829026264533926' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-2157541441812922602</id><published>2007-05-04T06:37:00.000-04:00</published><updated>2007-05-04T06:37:00.000-04:00</updated><title type='text'>you are a hero, as usual :)That said as you note p...</title><content type='html'>you are a hero, as usual :)&lt;BR/&gt;&lt;BR/&gt;That said as you note problems with long lines are not related to line wrapping (well, at least line wrapping isn't the top of the iceberg)... in fact rendering long lines is even worse when line wrapping is off.&lt;BR/&gt;&lt;BR/&gt;I am pretty sure there are a couple of bugs already open about the fact that the text widgets abuses pango layouts, but another one will not hurt :)&lt;BR/&gt;&lt;BR/&gt;/me adds himself to CC</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/2157541441812922602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/2157541441812922602'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178275020000#c2157541441812922602' title=''/><author><name>pbor</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-3983831620305775707</id><published>2007-05-04T05:38:00.000-04:00</published><updated>2007-05-04T05:38:00.000-04:00</updated><title type='text'>Behdad, I always love reading about your performan...</title><content type='html'>Behdad, I always love reading about your performance and Pango work. It makes me happy :-).&lt;BR/&gt;&lt;BR/&gt;I'm always promoting Gtk+ with my fellow devs, so it's always nice to see people improving it further.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/3983831620305775707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/3983831620305775707'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178271480000#c3983831620305775707' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-4333021834444047445</id><published>2007-05-03T22:22:00.000-04:00</published><updated>2007-05-03T22:22:00.000-04:00</updated><title type='text'>What I tried to describe is not limited to justifi...</title><content type='html'>What I tried to describe is not limited to justified text, no.  However, as I said, the bottleneck doesn't seem to be Pango per se, but the fact that Gtk+ voids Pango's caching by creating new Pango layouts all the time.  So, in your use case, there is still work to do, and that is why I opened bug 435405.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/4333021834444047445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/4333021834444047445'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178245320000#c4333021834444047445' title=''/><author><name>behdad</name><uri>http://www.blogger.com/profile/15683613908300939375</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='04900605915708655800'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-4900409241277265714</id><published>2007-05-03T21:50:00.000-04:00</published><updated>2007-05-03T21:50:00.000-04:00</updated><title type='text'>Does this also affect text rendering that is not j...</title><content type='html'>Does this also affect text rendering that is not justified? I have also been bothered by gedit's sluggishness with regards to what I thought was line-wrapping. Checking out SQL dumps in gedit always seemd to bring it down onto its kneews. Would be really sweet if those times are over now and I don't have to find alternatives to view SQL dumps with</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/4900409241277265714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/5389485403383060173/comments/default/4900409241277265714'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html?showComment=1178243400000#c4900409241277265714' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2007/05/avoiding-extra-work.html' ref='tag:blogger.com,1999:blog-5400308.post-5389485403383060173' source='http://www.blogger.com/feeds/5400308/posts/default/5389485403383060173' type='text/html'/></entry></feed>