<?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/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-6025222574084277369</id><updated>2009-11-14T07:27:03.759-08:00</updated><title type='text'>Clean Pixels</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cleanpixels.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default'/><link rel='alternate' type='text/html' href='http://cleanpixels.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>rogojin</name><uri>http://www.blogger.com/profile/03403818811126158552</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6025222574084277369.post-7790208074948277294</id><published>2009-11-14T06:57:00.000-08:00</published><updated>2009-11-14T07:27:03.770-08:00</updated><title type='text'>8 cores, 8 times as slow</title><content type='html'>We all know that most workloads don't scale linearly as you add more cores. But you know you've really screwed something up when your times go UP as you add more cores!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is how I managed to achieve this:&lt;/div&gt;&lt;div&gt;In &lt;a href="http://www.glssoft.com/pages/albion/features"&gt;Albion&lt;/a&gt;'s new renderer, I split the view up into tiles of say 256x256 pixels, and render the tiles on separate threads - regular graphics stuff. When all is going perfectly, the threads don't need to communicate with each other at all, and you get pretty much linear speedup. But one of the times when threads do need to communicate is when they're using shared resources - and fonts are one of those.&lt;/div&gt;&lt;div&gt;It's simplest for me just to have one font cache for the entire process, but obviously you need to synchronize access to this cache. When I originally created this font cache, I wasn't really thinking of synchronization, and when it came time to make it multithreaded, I just added a huge lock around every entry point, and thought I'll make those finer when I need to. Yesterday I definitely needed to.&lt;/div&gt;&lt;div&gt;In the particular scene I was looking at, I was zoomed in close, so the spatial culling was basically making all tiles render the same objects. As it turns out, I had 8 threads doing something approaching 8 times as much work, but unable to run in parallel. I don't think it gets worse than that!&lt;/div&gt;&lt;div&gt;This was really easy to find - you just hit pause on the debugger while it's running, and you see all your threads stalled at the same wait point.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6025222574084277369-7790208074948277294?l=cleanpixels.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cleanpixels.blogspot.com/feeds/7790208074948277294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6025222574084277369&amp;postID=7790208074948277294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/7790208074948277294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/7790208074948277294'/><link rel='alternate' type='text/html' href='http://cleanpixels.blogspot.com/2009/11/8-cores-8-times-as-slow.html' title='8 cores, 8 times as slow'/><author><name>rogojin</name><uri>http://www.blogger.com/profile/03403818811126158552</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07139690734890576173'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6025222574084277369.post-5066745454948800911</id><published>2009-04-14T05:33:00.000-07:00</published><updated>2009-05-17T14:09:42.221-07:00</updated><title type='text'>WPF rendering on Vista is ugly and blurry</title><content type='html'>&lt;div&gt;&lt;b&gt;UPDATE&lt;/b&gt;: I discovered the problem. It was the NVidia drivers for my 8600 GT. &lt;span class="Apple-style-span" style="font-family: Arial; border-collapse: collapse; font-size: 14px; line-height: 18px; "&gt;Previous drivers were 78.13 (7813). New drivers are 82.50 (8250). Running Vista x64 with .NET 3.5 SP1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;On my Vista machine, WPF rendering is nasty. I don't know what the engine is doing. My DPI setting is default (96 DPI). Aero is turned on.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On Vista, witness the nastiness:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_jea3iL54fmI/SeSEHUw7MLI/AAAAAAAAADA/cf_Af9wpuqg/s1600-h/WPF-Button-Vista.png"&gt;&lt;img style="WIDTH: 300px; HEIGHT: 100px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5324525920826634418" border="0" alt="" src="http://3.bp.blogspot.com/_jea3iL54fmI/SeSEHUw7MLI/AAAAAAAAADA/cf_Af9wpuqg/s320/WPF-Button-Vista.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On XP, the kind of quality we've come to expect:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_jea3iL54fmI/SeSEHcJ1NOI/AAAAAAAAAC4/LNleXN9D9bU/s1600-h/WPF-Button-XP.png"&gt;&lt;img style="WIDTH: 300px; HEIGHT: 100px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5324525922810148066" border="0" alt="" src="http://1.bp.blogspot.com/_jea3iL54fmI/SeSEHcJ1NOI/AAAAAAAAAC4/LNleXN9D9bU/s320/WPF-Button-XP.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I can't puzzle it out. Incredibly odd that I can't find any mention of this on the WWW.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6025222574084277369-5066745454948800911?l=cleanpixels.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cleanpixels.blogspot.com/feeds/5066745454948800911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6025222574084277369&amp;postID=5066745454948800911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/5066745454948800911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/5066745454948800911'/><link rel='alternate' type='text/html' href='http://cleanpixels.blogspot.com/2009/04/wpf-rendering-on-vista-is-ugly-and.html' title='WPF rendering on Vista is ugly and blurry'/><author><name>rogojin</name><uri>http://www.blogger.com/profile/03403818811126158552</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07139690734890576173'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_jea3iL54fmI/SeSEHUw7MLI/AAAAAAAAADA/cf_Af9wpuqg/s72-c/WPF-Button-Vista.png' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6025222574084277369.post-9027860073928353644</id><published>2008-10-02T02:14:00.000-07:00</published><updated>2008-10-02T02:26:57.389-07:00</updated><title type='text'>VC 2008 needs /Ox</title><content type='html'>Some of my database test functions picked up that a field read had gone from about 500 clocks to 1700 clocks, when upgrading from VS 2005 to VS 2008. I don't have time to investigate exactly what causes this, but changing the optimization setting from /O2 to /Ox fixes it (and actually makes 2008's code a bit faster than 2005 if I'm not mistaken).&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bottom line: Use /Ox for all release builds. The executable also seems to be smaller. Maybe it's the omission of the frame pointers.. I don't know.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6025222574084277369-9027860073928353644?l=cleanpixels.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cleanpixels.blogspot.com/feeds/9027860073928353644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6025222574084277369&amp;postID=9027860073928353644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/9027860073928353644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/9027860073928353644'/><link rel='alternate' type='text/html' href='http://cleanpixels.blogspot.com/2008/10/vc-2008-needs-ox.html' title='VC 2008 needs /Ox'/><author><name>rogojin</name><uri>http://www.blogger.com/profile/03403818811126158552</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07139690734890576173'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6025222574084277369.post-3421382655249361155</id><published>2008-09-05T10:48:00.000-07:00</published><updated>2008-09-05T10:51:35.721-07:00</updated><title type='text'>Shameless plug</title><content type='html'>This is a shameless plug for the GF's artwork. I slapped the website together. Apparently if I say the words &lt;a href="http://www.ginaheyer.com"&gt;Gina Heyer&lt;/a&gt; it works better. viva la vida.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6025222574084277369-3421382655249361155?l=cleanpixels.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cleanpixels.blogspot.com/feeds/3421382655249361155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6025222574084277369&amp;postID=3421382655249361155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/3421382655249361155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/3421382655249361155'/><link rel='alternate' type='text/html' href='http://cleanpixels.blogspot.com/2008/09/shameless-plug.html' title='Shameless plug'/><author><name>rogojin</name><uri>http://www.blogger.com/profile/03403818811126158552</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07139690734890576173'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6025222574084277369.post-471174516512825980</id><published>2008-04-18T02:53:00.000-07:00</published><updated>2008-09-04T03:11:24.573-07:00</updated><title type='text'>A nickel for every for loop</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; "&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;I was reading this &lt;a href="http://www.paulgraham.com/vanlfsp.html"&gt;short essay&lt;/a&gt; by Mike Vanier. At the end he says &lt;span class="Apple-style-span" style="font-style: italic; "&gt;"if I had a nickel for every time I've written "for (i = 0; i != N; i++)" in C I'd be a millionaire"&lt;/span&gt;. Hmm.. it looks like some people make a lot more off their for loops. The word 'for' appears 13527 times in the Quake3 source. At one nickel for every for loop, that would earn JC a cool $676.35. woot! He can finally afford that Voodoo 6.&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6025222574084277369-471174516512825980?l=cleanpixels.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cleanpixels.blogspot.com/feeds/471174516512825980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6025222574084277369&amp;postID=471174516512825980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/471174516512825980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/471174516512825980'/><link rel='alternate' type='text/html' href='http://cleanpixels.blogspot.com/2008/04/nickel-for-every-for-loop.html' title='A nickel for every for loop'/><author><name>rogojin</name><uri>http://www.blogger.com/profile/03403818811126158552</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07139690734890576173'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6025222574084277369.post-4355504028040182308</id><published>2008-03-13T21:08:00.000-07:00</published><updated>2008-03-13T21:10:40.583-07:00</updated><title type='text'>Bug in x64 optimizer in VS 2005, unfixed in VS 2008</title><content type='html'>&lt;p&gt;I came across a bug in the x64 optimizer yesterday. By the looks of this &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=255340"&gt;connect.microsoft.com item&lt;/a&gt;, it looks like it's been there since VS 2005, and it has not been fixed in VS 2008.&lt;/p&gt;&lt;p&gt;I don't understand the bug completely, but it seems to involve sign extension (using movsxd) when it should do unsigned extension of 32-bit integers to 64-bit.&lt;/p&gt;&lt;p&gt;In my specific usage case, I was splitting up the 32-bit integers into their upper and lower halves, by adding an offset of 0x80000000 for the upper half. My workaround was simply to use 0x80000000 - 1 instead of 0x80000000 as an offset. The optimizer ends up generating different code, which happens to be correct.&lt;/p&gt;&lt;p&gt;If you have any sway with MSFT, please get them to fix this bug. I don't know if the voting system on that connect.microsoft.com site works, but maybe it's worth a try.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6025222574084277369-4355504028040182308?l=cleanpixels.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cleanpixels.blogspot.com/feeds/4355504028040182308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6025222574084277369&amp;postID=4355504028040182308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/4355504028040182308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/4355504028040182308'/><link rel='alternate' type='text/html' href='http://cleanpixels.blogspot.com/2008/03/bug-in-x64-optimizer-in-vs-2005-unfixed.html' title='Bug in x64 optimizer in VS 2005, unfixed in VS 2008'/><author><name>rogojin</name><uri>http://www.blogger.com/profile/03403818811126158552</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07139690734890576173'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6025222574084277369.post-442194428237671038</id><published>2007-10-18T06:43:00.001-07:00</published><updated>2007-10-18T07:14:00.851-07:00</updated><title type='text'>Lighttpd patch for trunk:2001</title><content type='html'>For what it's worth- a lighttpd 1.5.0 update. This is built on /trunk:2001.&lt;br /&gt;&lt;br /&gt;Source Patch (use on /trunk revision 2001):&lt;br /&gt;&lt;a href="http://rogojin.googlepages.com/lighttpd_win32_2001.patch"&gt;lighttpd_win32_patch_2001.patch&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Binary:&lt;br /&gt;&lt;a href="http://rogojin.googlepages.com/setup_lighttpd_1.5.0.exe"&gt;lighttpd_win32_2001.exe&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6025222574084277369-442194428237671038?l=cleanpixels.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cleanpixels.blogspot.com/feeds/442194428237671038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6025222574084277369&amp;postID=442194428237671038' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/442194428237671038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6025222574084277369/posts/default/442194428237671038'/><link rel='alternate' type='text/html' href='http://cleanpixels.blogspot.com/2007/10/lighttpd-patch-for-trunk2001.html' title='Lighttpd patch for trunk:2001'/><author><name>rogojin</name><uri>http://www.blogger.com/profile/03403818811126158552</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07139690734890576173'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry></feed>