<feed xmlns='http://www.w3.org/2005/Atom'>
<title>st, branch 0.6</title>
<subtitle>a modified version of st (simple terminal)</subtitle>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/'/>
<entry>
<title>Commit to push the 0.6 release.</title>
<updated>2015-07-07T20:26:44+00:00</updated>
<author>
<name>Christoph Lohmann</name>
<email>20h@r-36.net</email>
</author>
<published>2015-07-07T20:26:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=92e092efe6c6b2a6b6ec9da33170317d4426cab0'/>
<id>92e092efe6c6b2a6b6ec9da33170317d4426cab0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Remove unnecessary XFilterEvent call."</title>
<updated>2015-07-02T09:11:55+00:00</updated>
<author>
<name>Weng Xuetian</name>
<email>wengxt@gmail.com</email>
</author>
<published>2015-07-02T06:31:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=5f48e89716a74e75b6040fdb067372180626b699'/>
<id>5f48e89716a74e75b6040fdb067372180626b699</id>
<content type='text'>
This reverts commit d2937b05aed9cee8d6651cd806d31682a853c773.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit d2937b05aed9cee8d6651cd806d31682a853c773.
</pre>
</div>
</content>
</entry>
<entry>
<title>do not truncate font size when zooming</title>
<updated>2015-06-19T09:49:13+00:00</updated>
<author>
<name>Quentin Rameau</name>
<email>quinq@quinq.eu.org</email>
</author>
<published>2015-05-31T10:26:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=bdd649a10289ade364f3deab3bbf6ee3169d67ca'/>
<id>bdd649a10289ade364f3deab3bbf6ee3169d67ca</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Optimize memory footprint of line buffers"</title>
<updated>2015-06-03T06:07:55+00:00</updated>
<author>
<name>Roberto E. Vargas Caballero</name>
<email>k0ga@shike2.com</email>
</author>
<published>2015-06-03T06:07:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=71fa10f613a22b3e75e0e897ee1be6667be3f449'/>
<id>71fa10f613a22b3e75e0e897ee1be6667be3f449</id>
<content type='text'>
This reverts commit 7ab6c92e18d468968811256e808b02309c160a22.
We need 32 bits for real color support.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 7ab6c92e18d468968811256e808b02309c160a22.
We need 32 bits for real color support.
</pre>
</div>
</content>
</entry>
<entry>
<title>Support UTF-8 characters as word delimiters</title>
<updated>2015-05-25T06:35:32+00:00</updated>
<author>
<name>Jan Christoph Ebersbach</name>
<email>jceb@e-jc.de</email>
</author>
<published>2015-05-22T14:06:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=caa97cc781ccf29f28c3d9e6683a66eb3f70e2bd'/>
<id>caa97cc781ccf29f28c3d9e6683a66eb3f70e2bd</id>
<content type='text'>
For a higher usefulness of the utf8strchr function, the index of the
UTF-8 character could be returned in addition with a Rune instead of a
char*.  Since utf8strchr is currently only used by ISDELIM I didn't
bother to increase the complexity.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For a higher usefulness of the utf8strchr function, the index of the
UTF-8 character could be returned in addition with a Rune instead of a
char*.  Since utf8strchr is currently only used by ISDELIM I didn't
bother to increase the complexity.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' of ssh://suckless.org/gitrepos/st</title>
<updated>2015-05-15T05:51:58+00:00</updated>
<author>
<name>Roberto E. Vargas Caballero</name>
<email>k0ga@shike2.com</email>
</author>
<published>2015-05-15T05:51:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=c03548750b2527a6ddb5edfd945c5799066a6224'/>
<id>c03548750b2527a6ddb5edfd945c5799066a6224</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>set selection to IDLE on clear</title>
<updated>2015-05-15T05:42:40+00:00</updated>
<author>
<name>v4hn</name>
<email>me@v4hn.de</email>
</author>
<published>2015-05-14T13:46:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=8e15887de95a7076b9515dcbb428b364f6dc3849'/>
<id>8e15887de95a7076b9515dcbb428b364f6dc3849</id>
<content type='text'>
Otherwise a tangling bmotion event will consider
the selection still valid and selnormalize segfaults
because of an invalid sel.ob.y index.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Otherwise a tangling bmotion event will consider
the selection still valid and selnormalize segfaults
because of an invalid sel.ob.y index.
</pre>
</div>
</content>
</entry>
<entry>
<title>Small bugfix for makeglyphfontspecs call in drawregion</title>
<updated>2015-05-12T05:37:13+00:00</updated>
<author>
<name>suigin</name>
<email>suigin@national.shitposting.agency</email>
</author>
<published>2015-05-09T22:22:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=89cf0fc597a2bcc16b1516c6f6d750a06175f1c7'/>
<id>89cf0fc597a2bcc16b1516c6f6d750a06175f1c7</id>
<content type='text'>
Here's a patch that fixes a bug when calling `makedrawglyphfontspecs'
in `drawregion'. Wasn't offseting the pointer into the input glyphs
array by `x1'. The bug isn't causing any problems currently, because
`drawregion' is always called with `x1' and `y1' values of 0, but if
this ever changes in the future, the bug would certainly cause some
problems.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Here's a patch that fixes a bug when calling `makedrawglyphfontspecs'
in `drawregion'. Wasn't offseting the pointer into the input glyphs
array by `x1'. The bug isn't causing any problems currently, because
`drawregion' is always called with `x1' and `y1' values of 0, but if
this ever changes in the future, the bug would certainly cause some
problems.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix the new -e handling. An empty cmd has to work for backwards compatibility.</title>
<updated>2015-05-10T13:19:48+00:00</updated>
<author>
<name>Christoph Lohmann</name>
<email>20h@r-36.net</email>
</author>
<published>2015-05-10T13:19:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=980991fa6e7b737d54f8e5c60c26275890eb28ff'/>
<id>980991fa6e7b737d54f8e5c60c26275890eb28ff</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up xdraws and optimize glyph drawing with non-unit kerning values</title>
<updated>2015-05-07T10:03:44+00:00</updated>
<author>
<name>suigin</name>
<email>suigin@national.shitposting.agency</email>
</author>
<published>2015-05-06T03:24:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.yctct.com/st/commit/?id=ae1923d27533ff46400d93765e971558201ca1ee'/>
<id>ae1923d27533ff46400d93765e971558201ca1ee</id>
<content type='text'>
I have another patch here for review that optimizes the performance of
glyph drawing, primarily when using non-unit kerning values, and fixes a
few other minor issues. It's dependent on the earlier patch from me that
stores unicode codepoints in a Rune type, typedef'd to uint_least32_t.

This patch is a pretty big change to xdraws so your scrutiny is
appreciated.

First, some performance numbers. I used Yu-Jie Lin termfps.sh shell
script to benchmark before and after, and you can find it in the
attachments. On my Kaveri A10 7850k machine, I get the following
results:

Before Patch
============

1) Font: "Liberation Mono:pixelsize=12:antialias=false:autohint=false"
   cwscale: 1.0, chscale: 1.0
   For 273x83 100 frames.
   Elapsed time :     1.553
   Frames/second:    64.352
   Chars /second: 1,458,159

2) Font: "Inconsolata:pixelsize=14:antialias=true:autohint=true"
   cwscale: 1.001, chscale: 1.001
   For 239x73 100 frames.
   Elapsed time :   159.286
   Frames/second:     0.627
   Chars /second:    10,953

After Patch
===========

3) Font: "Liberation Mono:pixelsize=12:antialias=false:autohint=false"
   cwscale: 1.0, chscale: 1.0
   For 273x83 100 frames.
   Elapsed time :     1.544
   Frames/second:    64.728
   Chars /second: 1,466,690

4) Font: "Inconsolata:pixelsize=14:antialias=true:autohint=true"
   cwscale: 1.001, chscale: 1.001
   For 239x73 100 frames.
   Elapsed time :     1.955
   Frames/second:    51.146
   Chars /second:   892,361

As you can see, while the improvements for fonts with unit-kerning is
marginal, there's a huge ~81x performance increase with the patch when
using kerning values other than 1.0.

So what does the patch do?

The `xdraws' function would render each glyph one at a time if non-unit
kerning values were configured, and this was the primary cause of the
slow down. Xft provides a handful of functions which allow you to render
multiple characters or glyphs at time, each with a unique &lt;x,y&gt; position,
so it was simply a matter of massaging the data into a format that would
allow us to use one of these functions.

I've split `xdraws' up into two functions. In the first pass with
`xmakeglyphfontspecs' it will iterate over all of the glyphs in a given
row and it will build up an array of corresponding XftGlyphFontSpec
records. Much of the old logic for resolving fonts for glyphs using Xft
and fontconfig went into this function.

The second pass is done with `xrenderglyphfontspecs' which contains the
old logic for determining colors, clearing the background, and finally
rendering the array of XftGlyphFontSpec records.

There's a couple of other things that have been improved by this patch.
For instance, the UTF-32 codepoints in the Line's were being re-encoded
back into UTF-8 strings to be passed to `xdraws' which in turn would then
decode back to UTF-32 to verify that the Font contained a matching glyph
for the code point. Next, the UTF-8 string was being passed to
`XftDrawStringUtf8' which internally mallocs a scratch buffer and decodes
back to UTF-32 and does the lookup of the glyphs all over again.

This patch gets rid of all of this redundant round-trip encoding and
decoding of characters to be rendered and only looks up the glyph index
once (per font) during the font resolution phase. So this is probably
what's responsible for the marginal improvements seen when kerning values
are kept to 1.0.

I imagine there are other performance improvements here too, not seen in
the above benchmarks, if the user has lots of non-ASCII code plane characters
on the screen, or several different fonts are being utilized during
screen redraw.

Anyway, if you see any problems, please let me know and I can fix them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I have another patch here for review that optimizes the performance of
glyph drawing, primarily when using non-unit kerning values, and fixes a
few other minor issues. It's dependent on the earlier patch from me that
stores unicode codepoints in a Rune type, typedef'd to uint_least32_t.

This patch is a pretty big change to xdraws so your scrutiny is
appreciated.

First, some performance numbers. I used Yu-Jie Lin termfps.sh shell
script to benchmark before and after, and you can find it in the
attachments. On my Kaveri A10 7850k machine, I get the following
results:

Before Patch
============

1) Font: "Liberation Mono:pixelsize=12:antialias=false:autohint=false"
   cwscale: 1.0, chscale: 1.0
   For 273x83 100 frames.
   Elapsed time :     1.553
   Frames/second:    64.352
   Chars /second: 1,458,159

2) Font: "Inconsolata:pixelsize=14:antialias=true:autohint=true"
   cwscale: 1.001, chscale: 1.001
   For 239x73 100 frames.
   Elapsed time :   159.286
   Frames/second:     0.627
   Chars /second:    10,953

After Patch
===========

3) Font: "Liberation Mono:pixelsize=12:antialias=false:autohint=false"
   cwscale: 1.0, chscale: 1.0
   For 273x83 100 frames.
   Elapsed time :     1.544
   Frames/second:    64.728
   Chars /second: 1,466,690

4) Font: "Inconsolata:pixelsize=14:antialias=true:autohint=true"
   cwscale: 1.001, chscale: 1.001
   For 239x73 100 frames.
   Elapsed time :     1.955
   Frames/second:    51.146
   Chars /second:   892,361

As you can see, while the improvements for fonts with unit-kerning is
marginal, there's a huge ~81x performance increase with the patch when
using kerning values other than 1.0.

So what does the patch do?

The `xdraws' function would render each glyph one at a time if non-unit
kerning values were configured, and this was the primary cause of the
slow down. Xft provides a handful of functions which allow you to render
multiple characters or glyphs at time, each with a unique &lt;x,y&gt; position,
so it was simply a matter of massaging the data into a format that would
allow us to use one of these functions.

I've split `xdraws' up into two functions. In the first pass with
`xmakeglyphfontspecs' it will iterate over all of the glyphs in a given
row and it will build up an array of corresponding XftGlyphFontSpec
records. Much of the old logic for resolving fonts for glyphs using Xft
and fontconfig went into this function.

The second pass is done with `xrenderglyphfontspecs' which contains the
old logic for determining colors, clearing the background, and finally
rendering the array of XftGlyphFontSpec records.

There's a couple of other things that have been improved by this patch.
For instance, the UTF-32 codepoints in the Line's were being re-encoded
back into UTF-8 strings to be passed to `xdraws' which in turn would then
decode back to UTF-32 to verify that the Font contained a matching glyph
for the code point. Next, the UTF-8 string was being passed to
`XftDrawStringUtf8' which internally mallocs a scratch buffer and decodes
back to UTF-32 and does the lookup of the glyphs all over again.

This patch gets rid of all of this redundant round-trip encoding and
decoding of characters to be rendered and only looks up the glyph index
once (per font) during the font resolution phase. So this is probably
what's responsible for the marginal improvements seen when kerning values
are kept to 1.0.

I imagine there are other performance improvements here too, not seen in
the above benchmarks, if the user has lots of non-ASCII code plane characters
on the screen, or several different fonts are being utilized during
screen redraw.

Anyway, if you see any problems, please let me know and I can fix them.
</pre>
</div>
</content>
</entry>
</feed>
