<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kuwamoto.org</title>
	<atom:link href="http://kuwamoto.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://kuwamoto.org</link>
	<description>various stuff, mostly boring</description>
	<lastBuildDate>Wed, 04 Jul 2012 21:01:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>
	<item>
		<title>Why I&#8217;m not excited about the Higgs boson</title>
		<link>http://kuwamoto.org/2012/07/04/why-im-not-excited-about-the-higgs-boson/</link>
					<comments>http://kuwamoto.org/2012/07/04/why-im-not-excited-about-the-higgs-boson/#comments</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Wed, 04 Jul 2012 21:01:44 +0000</pubDate>
				<category><![CDATA[science]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=342</guid>

					<description><![CDATA[A friend at work (@obviouscorp) asked me why the Higgs boson was such a big deal. And as nearly as I can tell, the answer is &#8220;It&#8217;s not.&#8221; Now don&#8217;t get me wrong. I think the discovery of a particle we have been hunting down for 50 years is a big deal. But I&#8217;m still [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A friend at work (<a href="http://obvious.com">@obviouscorp</a>) asked me why the Higgs boson was such a big deal. And as nearly as I can tell, the answer is &#8220;It&#8217;s not.&#8221;</p>
<p>Now don&#8217;t get me wrong. I think the discovery of a particle we have been hunting down for 50 years is a big deal. But I&#8217;m still not excited.</p>
<p><strong>Background</strong></p>
<p>I happen to have a PhD in physics, but I left the field right after getting my degree almost 20 years ago. So I&#8217;m basically a layman at this point, but I do have a background in some of this stuff.</p>
<p>I&#8217;ve done a good amount of digging into articles, forums, etc., and I find that a lot of the information out there is confusing. This is my current understanding of what the Higgs actually is. It think it&#8217;s basically right, but there is a chance that I have some of it wrong. If anyone who is current on the research can help correct any misperceptions I have, that would be awesome.</p>
<p><strong>Different kinds of mass</strong></p>
<p>Roughly speaking, scientists are interested in the Higgs field because it helps explain where mass comes from. But the word &#8220;mass&#8221; can mean many things.</p>
<p>The term &#8220;inertial mass&#8221; is the idea of how hard it is to push something. If something is massive, you need to apply more force in order to move it.</p>
<p>The term &#8220;gravitational mass&#8221; is the idea of how strongly a piece of matter attracts other things with mass. If something is massive, it pulls you toward itself.</p>
<p>As it turns out, these two concepts of mass are identical. In other words, if something is twice as heavy in terms of &#8220;hard to push&#8221;, its gravity also pulls twice as hard.</p>
<p><strong>The confusing molasses analogy</strong></p>
<p>Many science writers talk about the Higgs field giving mass to particles by &#8220;slowing them down&#8221; like marbles traveling through molasses. This is obviously just a colorful metaphor, but I took this to mean that the Higgs field explained the concept of inertial mass, i.e., why massive things are hard to push.</p>
<p>If that were true, it would be super exciting, because it&#8217;s such a fundamental concept. But I couldn&#8217;t see how it could possibly be true, for a bunch of reasons.</p>
<p>As it turns out, that&#8217;s not what scientists are saying. To understand what scientists are actually saying, you have to know a little bit about our current view of the world of subatomic particles.</p>
<p><strong>Mass, vs. other properties</strong></p>
<p>As far as we know, the &#8220;stuff&#8221; in the world is made up of quarks and leptons. An electron is an example of a lepton. There are six leptons total (or 12, if you count anti-particles). There are also six kinds of quarks (or 12, if you count anti-quarks). Finally, there are four force mediating particles (e.g, photons, gluons, etc.).</p>
<p>All of these particles have properties, like &#8220;charge&#8221;. An electron has a -1 charge. An up quark has a +2/3 charge.</p>
<p>These properties tend to come in exact increments. For example, the spin of a particle can be 1/2, 1, -1/2, etc. Nothing in between.</p>
<p>Mass is different. The masses of particles have totally bizarre values. Photons have zero mass. Neutrinos (probably) have mass, but it is such a tiny, tiny amount of mass that we have trouble detecting their existence. Meanwhile, the top quark has as mass of 170GeV or so. That&#8217;s something like 100 billion times heavier than a neutrino.</p>
<p>So scientists look at that and say &#8220;why is mass so weird?&#8221;</p>
<p><strong>Rest mass vs. energy</strong></p>
<p>The masses of particles I referred to above is more properly called &#8220;rest mass&#8221;. We use that specific term because energy also counts toward &#8220;mass&#8221;. If an electron is at rest, it has .5 MeV of mass. But if it&#8217;s moving really fast, that electron has more mass because of the energy of its motion. </p>
<p>All kinds of energy contributes to mass. For example, let&#8217;s look at protons. </p>
<p>A proton is composed of two up quarks and a down quark. But if you add up the &#8220;rest mass&#8221; of two up quarks and a down quark, you end up with much, much less mass than the mass of a proton. That&#8217;s because 99% of the mass of a proton comes from the energy that binds all three quarks together. Weird, right? 99% of the mass is just energy. 1% comes from the rest mass of the stuff inside.</p>
<p><strong>No more rest mass</strong></p>
<p>Ok&#8230; with all that in mind, here&#8217;s my current understanding of what it means for the Higgs field to be the source of mass.</p>
<p>The Higgs field lets you replace the rest mass of particles with another energy term, which means that all particles are massless, and there is no such thing as &#8220;rest mass&#8221;. That makes our equations cleaner, and gets rid of a messy concept (rest mass).</p>
<p>That&#8217;s pretty fundamental, so I guess I understand why people are excited.</p>
<p><strong>Why do you keep saying &#8220;Higgs field&#8221; instead of &#8220;Higgs boson&#8221;?</strong></p>
<p>In the standard model, all fields are mediated by force-carrying particles. The electromagnetic force is mediated by photons, and the strong force is mediated by gluons. It&#8217;s kind of complicated, but the force and the particle are kind of the same thing.</p>
<p>When you talk about stuff that comes out of particle accelerators, you tend to talk about the particles (Higgs boson). When you talk about how they affect things in the world, you tend to talk about fields or forces (the Higgs field).</p>
<p>But it&#8217;s all the same thing.</p>
<p><strong>Why I&#8217;m not excited</strong></p>
<p>Ok. So we found something that looks like the Higgs boson, which gives more weight to this theory that the Higgs field is the source of the rest mass of fundamental particles. </p>
<p>We still have the question of why the masses of particles are so different from one another. Before, we said &#8220;we have no idea what mass is, and why the values are so weird.&#8221; Now, we say &#8220;rest mass comes from the Higgs field, and we have no idea why the coupling constants are so weird.&#8221; (coupling constant is just a fancy way of saying &#8220;how much each kind of particle is affected by the Higgs field&#8221;)</p>
<p>Now the normal answer to the question of why the coupling constants got to be the way they are is &#8220;spontaneous symmetry breaking&#8221;, which is a fancy way of saying &#8220;it happened a long time ago, and was basically random&#8221;.</p>
<p>I guess that&#8217;s progress, but it&#8217;s not super satisfying.</p>
<p>Another way to read the news is something like this: &#8220;Our model for how the universe works is still basically correct&#8221;.</p>
<p>I guess that&#8217;s news, but I would have been more excited by the opposite result.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2012/07/04/why-im-not-excited-about-the-higgs-boson/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
			</item>
		<item>
		<title>The story behind the new Notespark icon</title>
		<link>http://kuwamoto.org/2010/11/03/the-story-behind-the-new-notespark-icon/</link>
					<comments>http://kuwamoto.org/2010/11/03/the-story-behind-the-new-notespark-icon/#respond</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Wed, 03 Nov 2010 20:33:03 +0000</pubDate>
				<category><![CDATA[notespark]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=326</guid>

					<description><![CDATA[Ryan Hicks (from Adobe&#8217;s XD team) designed the new Notespark icon for us. He did a writeup of what the design challenges were and how he approached the problem. Check it out!]]></description>
										<content:encoded><![CDATA[<p>Ryan Hicks (from Adobe&#8217;s XD team) designed the new Notespark icon for us.</p>
<p>He did a writeup of what the design challenges were and how he approached the problem. <a href="http://rhworks.com/archives/2010/10/notespark.html">Check it out</a>!</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2010/11/03/the-story-behind-the-new-notespark-icon/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Announcing our new startup &#8212; Phile</title>
		<link>http://kuwamoto.org/2010/11/02/announcing-phile/</link>
					<comments>http://kuwamoto.org/2010/11/02/announcing-phile/#comments</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Wed, 03 Nov 2010 00:04:48 +0000</pubDate>
				<category><![CDATA[phile]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=319</guid>

					<description><![CDATA[For those people who have been following me since the days when I used to keep this blog up to date&#8230; I thought you might want to know that I&#8217;ve started a new startup called Phile, which launched a public beta earlier today. There are lots of ways to think about Phile, but in many [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>For those people who have been following me since the days when I used to keep this blog up to date&#8230; I thought you might want to know that I&#8217;ve started a new startup called Phile, which launched a public beta earlier today.</p>
<p>There are lots of ways to think about Phile, but in many ways, it&#8217;s a synthesis of everything I learned in working on Dreamweaver, Contribute, Flex, and other products during my tenure at Adobe and Macromedia.</p>
<p>Phile is a service that lets anyone create a website to gather information about any topic in a social and structured way. It&#8217;s kind of like a Yelp-builder for any topic. You get to customize the site using a tooling interface that makes it feel kind of like FileMaker or HyperCard.</p>
<p>The best way to explain what it is is to show you a screencast:</p>
<p>http://www.youtube.com/watch?v=msbP3NuVQpE</p>
<p>There is also an article that you can find here:</p>
<p>	<a href="http://venturebeat.com/2010/11/02/phile-makes-it-easy-to-create-special-interest-groups-on-the-web-3/">http://venturebeat.com/2010/11/02/phile-makes-it-easy-to-create-special-interest-groups-on-the-web-3/</a></p>
<p>Phile has been a labor of love for me and Mike for over a year. I&#8217;d love for you to try it out and tell me what you think. And if you think it&#8217;s interesting, I&#8217;d love to have you help me spread the word.</p>
<p>Thanks!</p>
<p>-Sho</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2010/11/02/announcing-phile/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Apple vs. Lean Startups</title>
		<link>http://kuwamoto.org/2009/12/11/apple-vs-lean-startups/</link>
					<comments>http://kuwamoto.org/2009/12/11/apple-vs-lean-startups/#comments</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Fri, 11 Dec 2009 20:10:06 +0000</pubDate>
				<category><![CDATA[design]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=285</guid>

					<description><![CDATA[Recently, Andrew Chen has been mulling over the differences between Apple&#8217;s approach to product design and (a) the typical corporate approach and (b) the &#8220;lean startups&#8221; approach. In a recent post, he proposed the idea of a &#8220;minimal desirable product&#8221; to try to blend Apple&#8217;s approach and the lean startups approach. I kind of agree [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="http://kuwamoto.org/wp-content/uploads/2009/12/apple_vs_lean.png"><img fetchpriority="high" decoding="async" src="http://kuwamoto.org/wp-content/uploads/2009/12/apple_vs_lean.png" alt="apple_vs_lean" title="apple_vs_lean" width="450" height="218" class="alignright size-full wp-image-292" srcset="http://kuwamoto.org/wp-content/uploads/2009/12/apple_vs_lean.png 450w, http://kuwamoto.org/wp-content/uploads/2009/12/apple_vs_lean-300x145.png 300w" sizes="(max-width: 450px) 100vw, 450px" /></a>Recently, Andrew Chen has been mulling over the differences between Apple&#8217;s approach to product design and (a) the typical corporate approach and (b) the &#8220;lean startups&#8221; approach. <a href="http://andrewchenblog.com/2009/12/07/minimum-desirable-product/" target="_blank">In a recent post,</a> he proposed the idea of a &#8220;minimal desirable product&#8221; to try to blend Apple&#8217;s approach and the lean startups approach.</p>
<p>I kind of agree with him, but his formulation makes my head hurt. </p>
<p>Apple&#8217;s design strategy is to work behind closed doors to build kick ass products that blow you away. They make design choices (like killing sub-par projects) that would make other companies cringe. By working behind closed doors, they are counting on their own design and vision instead of letting the market do the design. Sometimes, they succeed (iPhone) and sometimes they fail (AppleTV so far). When they get it right, they build stuff that is so desirable that people cannot believe their eyes.</p>
<p>The lean startups approach is to build the minimal thing that can possibly sell, get it out there, and then to iterate quickly. The lean startups philosophy says that no central planner can ever outsmart the market, so it&#8217;s dangerous to try to design behind closed doors. Instead of wasting time trying to build the perfect product, lean startups get it out there quickly and spend their time listening to the market and iterating.</p>
<p>Both approaches make sense. And it makes sense to ask what one approach might learn from the other. However, the middle ground between Apple&#8217;s approach of building the &#8220;most desirable product&#8221; and the lean startups approach of building a &#8220;minimal product&#8221; is not to build a &#8220;minimal desirable product.&#8221; That formulation doesn&#8217;t even make sense. So I should only somewhat kick ass? Or minimally kick ass? Could the iPhone have been &#8220;desirable&#8221; without animation? Probably. Would it have been as successful? Probably not.</p>
<h3>Why is &#8220;minimal&#8221; important?</h3>
<p>Building minimal products is important because product teams are notoriously bad at building good products. </p>
<p><strong>Featuritis:</strong> Given more resources, a team will typically add more features instead of polishing the features they already have, on the theory that more features = more market share. &#8220;Hey! We have more time so let&#8217;s make our microwave play CDs. People like to listen to music while cooking, right?&#8221;</p>
<p><strong>Listening to customers is hard:</strong> You <strong>must</strong> listen to your customers to understand what their problems are, but you <strong>absolutely cannot</strong> trust them to tell you how to design a solution for it. They&#8217;ll tell you that your product should automatically scan their inbox, and when you build exactly what they told you to build, they&#8217;ll hate it.</p>
<p><strong>Killer features are counterintuitive:</strong> When we were working on Dreamweaver, we got some things really right and some things really wrong. Round trip HTML was really important. Layout Table view wasn&#8217;t popular, and we spent a lot of time on it. It&#8217;s really hard to distinguish between killer features and phantom killer features that look good on paper but don&#8217;t end up being killer features after all.</p>
<p><strong>You may have the wrong market in mind:</strong> When doing design in a closed room, you have a specific market in mind. Meanwhile, your product idea may be best suited to a slightly different market. Spending months and months refining and adding to a product with the first market hypothesis in mind may actually put you behind the eight ball in pivoting to your actual market.</p>
<p><strong>Minimal products means quicker iteration:</strong> This is an obvious statement, but this is one of the most important benefits of building a minimal product. Large products with lots of features are like battleships, and while there is a time and place for battleships, they are hard to steer. Smaller, more nimble products may outrun you.</p>
<h3>Why is &#8220;minimal&#8221; dangerous?</h3>
<p>Starting with a minimal product and iterating have a lot of advantages, but this approach also has a few disadvantages.</p>
<p><strong>The MVP -> iterate process may not lead to joy: </strong> When you play with a well designed product, you are filled with a sense of joy. The whole mindset around minimal+iterate <strong>may</strong> lead to that sense of joy, but more likely than not, it leads to prioritizing function over design. Capability over joy. </p>
<p><strong>Minimal products may not be a good test of the market: </strong> Sometimes, doing something minimal is the best way to dip your toe into a market. And sometimes, you may get a false negative because the thing you build &#8220;minimally&#8221; tells you that the market isn&#8217;t there.</p>
<p><strong>You may end up cutting corners you wish you hadn&#8217;t</strong> Best summarized <a href="http://coconutheadsets.com/2009/11/28/the-dark-side-of-customer-development-and-lean-startups/" target="_blank">here</a>.</p>
<h3>Proper minimal design: Build half a product, not a half-assed product</h3>
<p>This advice, of course, is from <a href="http://gettingreal.37signals.com/ch05_Half_Not_Half_Assed.php" target="_blank">37 Signals</a>. It seems like just yesterday that these guys were the supposed gurus on building great products and now it&#8217;s other people who are the gurus. We should take everyone&#8217;s advice with a grain of salt, of course, but in this case, I think the 37 Signals guys have it right.</p>
<p>Focusing on design is not right for every lean startup. It really depends on the market you&#8217;re going after and the problem you&#8217;re trying to solve. But if you <strong>do</strong> need to focus on design, then I think it&#8217;s even more important to focus on the core essence of what you have and discard everything else. Be ruthless in cutting functionality to boil your product down to its core essence (no cut and paste in iPhone, right?) but then hone and polish and rethink the crap out what&#8217;s left until it elicits joy. And then follow the lean startup model to find customer fit.</p>
<p>Making a small product is hard (â€œI would have written less if I had more timeâ€) but polishing a small product is easier than polishing a big product with a bunch of extraneous features. And when you get it right, you will have a thing of beauty.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2009/12/11/apple-vs-lean-startups/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>State of the design economy?</title>
		<link>http://kuwamoto.org/2009/12/11/state-of-the-design-economy/</link>
					<comments>http://kuwamoto.org/2009/12/11/state-of-the-design-economy/#comments</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:22:56 +0000</pubDate>
				<category><![CDATA[design]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=281</guid>

					<description><![CDATA[Mike and I have had our heads down for most of the year working on our next project (which we are INCREDIBLY excited about, but not yet ready to talk about publicly). We&#8217;re at the point where we need design help, and we need help with everything: branding / identity, usability / UX, CSS / [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Mike and I have had our heads down for most of the year working on our next project (which we are INCREDIBLY excited about, but not yet ready to talk about publicly).</p>
<p>We&#8217;re at the point where we need design help, and we need help with everything: branding / identity, usability / UX, CSS / HTML production, etc. As a side effect of looking for great designers, we&#8217;ve gotten an interesting look into the state of the design economy.</p>
<p>For UX and identity, we started by looking for the designers we really want to work with (mostly high end) and going down the list. These guys are <strong>busy!</strong> Every firm we&#8217;ve contacted is working at capacity, and if anything, they are looking to staff up in order to deal with the workload. Even though that makes our job harder, I like the fact that these guys are busy.</p>
<p>For CSS / HTML production, we went the opposite route. Because of the nature of our product, we will probably need to work with multiple designers of this type and we put out an open call for submissions on Craigslist. After posting last night (at around 9pm) I found my inbox filled with seventy responses. Some of them were terrible, but some of them were great.</p>
<p>It&#8217;s been a while since I&#8217;ve posted a Craigslist job listing, so I don&#8217;t have a good baseline. Is getting 70 responses overnight for a design gig typical? And what&#8217;s the best explanation for the disparity between how busy theUX and branding guys were vs. the HTML / CSS guys? Is it the difference between looking at high end firms vs. doing a craigslist ad? (probably). Or is it that these two design disciplines have different economics?</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2009/12/11/state-of-the-design-economy/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Worth a read</title>
		<link>http://kuwamoto.org/2009/10/21/worth-a-read/</link>
					<comments>http://kuwamoto.org/2009/10/21/worth-a-read/#respond</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Wed, 21 Oct 2009 16:44:24 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=278</guid>

					<description><![CDATA[James Polanco of DevelopmentArc has a great post on Flash Player internals. Worth a read. http://www.developmentarc.com/site/2009/10/flash-player-internals-101-recap-part-one/]]></description>
										<content:encoded><![CDATA[<p>James Polanco of DevelopmentArc has a great post on Flash Player internals. Worth a read.</p>
<p><a href="http://www.developmentarc.com/site/2009/10/flash-player-internals-101-recap-part-one/">http://www.developmentarc.com/site/2009/10/flash-player-internals-101-recap-part-one/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2009/10/21/worth-a-read/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>JavaScript performance optimization, take 1</title>
		<link>http://kuwamoto.org/2009/10/09/javascript-performance-optimization-1/</link>
					<comments>http://kuwamoto.org/2009/10/09/javascript-performance-optimization-1/#comments</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Fri, 09 Oct 2009 23:32:45 +0000</pubDate>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=249</guid>

					<description><![CDATA[For the last several months, Mike and I have been working on a new project, which is nearing closed beta. That means we need to start battening down the hatches, and today was the day to start tackling client-side JavaScript performance. I&#8217;ve actually done quite a bit of performance work in my life, but not [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>For the last several months, Mike and I have been working on a new project, which is nearing closed beta. That means we need to start battening down the hatches, and today was the day to start tackling client-side JavaScript performance.</p>
<p>I&#8217;ve actually done quite a bit of performance work in my life, but not with JavaScript, so I though I&#8217;d take some notes along the way.</p>
<h3>Firebug is your friend</h3>
<p>In my mind, there are really three ways to a significant dent in performance:</p>
<ol>
<li>Find bad algorithms and replace them with fast ones</li>
<li>Find code that doesn&#8217;t actually have to be called and skip it.</li>
<li>Optimize the code that gets called most often</li>
</ol>
<p>And you really can&#8217;t do any of the three without a profiler. You might think you know what the problem is, but you won&#8217;t know until you profile it. In my case, I started out thinking that I had event listeners hanging around that weren&#8217;t letting go of their events, but the profiler (in this case, Firebug) told me I was completely wrong.</p>
<p>To get started profiling in Firebug, go to the console tab, press the &#8216;profile&#8217; button, do some stuff, and hit the &#8216;profile&#8217; button again. That&#8217;s it.</p>
<p>You&#8217;ll then be presented with data that looks like this:</p>
<p><a href="http://kuwamoto.org/wp-content/uploads/2009/10/Picture-1.png"><img decoding="async" src="http://kuwamoto.org/wp-content/uploads/2009/10/Picture-1-300x84.png" alt="Firebug" title="Firebug" width="300" height="84" class="aligncenter size-medium wp-image-255" srcset="http://kuwamoto.org/wp-content/uploads/2009/10/Picture-1-300x84.png 300w, http://kuwamoto.org/wp-content/uploads/2009/10/Picture-1-1024x288.png 1024w, http://kuwamoto.org/wp-content/uploads/2009/10/Picture-1.png 1336w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>For my money, the two most important columns are &#8216;own time&#8217; and &#8216;time&#8217;. &#8216;time&#8217; is the total time spent in a function including any functions that are called by that function, and &#8216;own time&#8217; is the same thing minus the time taken up by other functions.</p>
<h3>Problem: $$(&#8216;.class&#8217;) can be SLOW!</h3>
<p>I created a test where I did the same UI gesture 8 times, and this is what I discovered. Looking at &#8216;own time&#8217; told me that most of my time was going to DOM traversal via the $$ function.</p>
<p>Looking at &#8216;time&#8217; told me that the methods responsible for calling $$ were all central functions that were called in many places throughout my code, so it was worth making them as efficient as possible before figuring out whether there was a way to avoid calling some of them altogether. </p>
<h3>Phase 1 &#8212; replacing traversals of the entire DOM tree (via $$) with smaller traversals</h3>
<p>Roughly speaking, this corresponds to strategy (3).</p>
<table class="data">
<tr class="odd">
<th>What</th>
<th>total time</th>
<th>%delta<br />
from prev</th>
<th>%delta<br />
from base</th>
</tr>
<tr class="even">
<td>Baseline</td>
<td>2812ms</td>
<td>&#8212;</td>
<td>&#8212;</td>
</tr>
<tr class="odd">
<td>Replace $$(&#8216;.class&#8217;) by $(&#8216;section&#8217;).getElements(&#8216;.class&#8217;) in critical sections</td>
<td>2345ms</td>
<td>20%</td>
<td>20%</td>
</tr>
<tr class="even">
<td>Chage getElements(&#8216;.class&#8217;) to getElements(&#8216;div.class&#8217;) in critical sections</td>
<td>2094ms</td>
<td>12%</td>
<td>34%</td>
</tr>
<tr class="odd">
<td>Found more places to do the above optimizations</td>
<td>1723ms</td>
<td>22%</td>
<td>63%</td>
</tr>
<tr class="even">
<td>Replaced getElements() with getChildren() where possible</td>
<td>1641ms</td>
<td>5%</td>
<td>71%</td>
</tr>
</table>
<p>Along the way, I tried all sorts of other optimizations, but none of them yielded much benefit. Now that I was reaching the point of diminishing returns, it was time to see if there were chunks of code I could safely skip.</p>
<h3>Phase 2 &#8212; skipping handler functions when possible</h3>
<p>I knew that there was almost certainly code I was running that could be skipped (strategy 2). Why?</p>
<p>I find that when writing UI code, it is often easier to use brute force to make sure that everything is working consistently. For example, if an AJAX call updates a certain part of the screen, it is often easier to blow away all event handlers from everything and re-add them where needed, rather than just patching up event handlers for the portion of the screen that was updating.</p>
<p>My rationale is that you can always fix this at the end. And well, it was now time to pay the piper.</p>
<p>My test case involved doing the same UI gesture 8 times. And most of the time was going to the following functions:</p>
<p><code><br />
add_panel_handlers_if_needed(): 8 times<br />
add_content_handlers(): 16 times<br />
add_panel_handlers(): 8 times<br />
actually_do_drag_cleanup(): 8 times<br />
remove_content_handlers(): 24 times<br />
fix_detail_handlers(): 8 times<br />
handle_click(): 8 times<br />
fix_toggle_rte_handlers(): 8 times<br />
add_drag_handlers_and_start(): 8 times<br />
add_insert_handlers(): 8 times<br />
</code></p>
<p>You can see that some functions are being called 8 times and some were being called 24 times. As it turns out, this was just due to programmer laziness. By adding a few checks, some of those redundant calls could be safely avoided.</p>
<p>The other thing that was causing extra work is that only certain interactions caused screen updates that needed event handlers to be reattached. By writing some code to check for that, I was able to avoid many of these calls altogether.</p>
<table class="data">
<tr class="odd">
<th>What</th>
<th>total time</th>
<th>%delta<br />
from prev</th>
<th>%delta<br />
from base</th>
</tr>
<tr class="even">
<td>Baseline</td>
<td>2812ms</td>
<td>&#8212;</td>
<td>&#8212;</td>
</tr>
<tr class="odd">
<td>End of phase 1</td>
<td>1641ms</td>
<td>71%</td>
<td>71%</td>
</tr>
<tr class="even">
<td>Remove redundant calls to remove_content_handlers and add_content_handlers</td>
<td>1389ms</td>
<td>18%</td>
<td>102%</td>
</tr>
<tr class="odd">
<td>Skip certain fixup calls when content is determined not to have changed</td>
<td>1073ms</td>
<td>29%</td>
<td>162%</td>
</tr>
</table>
<p>(P.S. there is some small part of my brain that tells me that instead of manually worrying about these event handlers, I should just bite the bullet and switch to JQuery. But I&#8217;m not there yet.)</p>
<h3>Summary</h3>
<p>So, what&#8217;s the moral? First off, doing $$(&#8216;.class&#8217;) is slow. Second, large performance boosts usually come from a combination of skipping code that doesn&#8217;t have to run and optimizing the code that does. This was no exception. </p>
<p>One more thing. I just have to say that Firebug is amazing. I expected it to have trouble giving useful timings in the face of inconsistent UI gestures and garbage collection, but it did the &#8220;right thing&#8221;, which many desktop profilers don&#8217;t manage to do. If I had one wish, I wish I could get it to bundle up calls from specified library files and allocate the time spent in them to the calling function. </p>
<p>Ok. Back to more optimizing.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2009/10/09/javascript-performance-optimization-1/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>YAWR &#8211; Yet another watchmen review</title>
		<link>http://kuwamoto.org/2009/03/11/yawr-yet-another-watchmen-review/</link>
					<comments>http://kuwamoto.org/2009/03/11/yawr-yet-another-watchmen-review/#respond</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Thu, 12 Mar 2009 04:37:24 +0000</pubDate>
				<category><![CDATA[uncategorized]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=240</guid>

					<description><![CDATA[Ok. So now I&#8217;ve seen the Watchmen movie. It&#8217;s about as good as I could imagine the movie being, and I followed Scott Knaster&#8217;s advice: I enjoyed it for what it is. Yes, the movie had faults, but it&#8217;s hard to imagine how those faults could have been corrected without major departures from the source [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Ok. So now I&#8217;ve seen the Watchmen movie. It&#8217;s about as good as I could imagine the movie being, and I followed Scott Knaster&#8217;s advice: I enjoyed it for what it is.</p>
<p>Yes, the movie had faults, but it&#8217;s hard to imagine how those faults could have been corrected without major departures from the source material, which would have been devastating in its own way. Rock, meet hard place.</p>
<p>Now, for my take. I&#8217;ll try not to cover ground that has been beaten to death elsewhere. (mild spoilers ahead)</p>
<p><span id="more-240"></span></p>
<h3>A mystery without clues</h3>
<p>The narrative heart of the Watchmen is a detective story. It starts out with Rorschach literally playing detective, and the mystery unfolds from there. &#8220;Who killed the Comedian&#8221; turns into &#8220;Who is killing the Watchmen&#8221; to &#8220;What the f*ck is going on?&#8221; In making the jump from comic to movie, I feel that the Watchmen lost the driving force of the core detective story.</p>
<p>In the comic, the mystery was fueled by clues scattered throughout the comic: in pieces of paper lying on the street, in extra bonus material, and in tiny bits of dialogue.</p>
<p>Watching the movie, I was left with the feeling that the question was posed (&#8220;Who killed the Comedian?&#8221;) but the rest of the movie didn&#8217;t follow through in keeping the mystery alive. Where were the clues leading you to suspect one person or the other? Sure, there were scenes of Rorschach beating people up and asking questions (&#8220;what is Pyramid Transnational?&#8221;) but did that really cause anyone to be drawn into the mystery? Was anyone sitting in the movie theater trying to figure out &#8220;whodunit?&#8221;</p>
<h3>Central premise, part 1 &#8211; costumed heroes</h3>
<p>The central premise of the Watchmen is this: &#8220;What would the world be like if superheroes were real?&#8221; Part 1 of this premise has to do with costumed heroes. What kind of people dress up and beat people up at night? </p>
<p>As in the book, the movie portrays costumed heroes as, shall we say, less than perfect. Ok. They&#8217;re mostly psychopaths. In some cases, that was done brilliantly, as in Rorschach, who I thought was portrayed almost perfectly. In other cases, I wish there were a bit more gray instead of black and white. Yes, the Comedian is an A-hole, but what about showing us some heroics in a flashback scene to before hitting us with the fact that he is an A-hole? </p>
<p>Without the gray area, the costumed heroes seem like lawless thugs, and the Keene act seems like a really good idea, as opposed to a difficult moral question that would inspire actual political tension. </p>
<p>As for the over-the-top action, I am a fan. Sure, it makes absolutely no sense whatsoever that Adrian Veidt could crack a marble countertop with the Comedian&#8217;s head, but hey&#8230; it&#8217;s a movie.</p>
<h3>Central premise, part 2 &#8211; actual superheroes</h3>
<p>Part 2 of the &#8220;what if superheroes were real&#8221; question concerns actual superheroes with actual powers, aka Dr. Manhattan. </p>
<p>Watching Dr. Manhattan on a movie screen was a revelation to me. In the comic, for some reason, the idea of a near-omnipotent being becoming detached from humanity seemed, well, plausible but not believable, if that makes sense. I couldn&#8217;t get into Dr. Manhattan&#8217;s head because he&#8217;s not supposed to be all that human.</p>
<p>Meanwhile, seeing Dr. Manhattan on the movie screen, rotating CGI-generated widgets around in the air and talking in his &#8220;I can barely remember what it&#8217;s like to be human&#8221; voice made that omnipotence seem all that much more real to me. I could <em>imagine</em> what it would be like to live in a world that had a Dr. Manhattan in it, and it was kind of scary.</p>
<p>There were other aspects that didn&#8217;t work so well &#8212; how could anyone fall in love with something so alien? &#8212; but overall, it deepened my appreciation for this character.</p>
<h3>Central premise, part 3 &#8211; political ramifications</h3>
<p>The third part of the &#8220;what if superheroes were real&#8221; question has to do with politics and the world as a whole. </p>
<p>In the comic, America has morphed into something only barely recognizable. Tricky Dick is still in power running a quasi-totalitarian version of the US government (shades of Philip K Dick?) and there are lots of specific details about modern life that are just, well, different. Blimps and curry, anyone?</p>
<p>In the movie, the same elements are there, but it just doesn&#8217;t provide the same mindf*ck as the comic. The main reason for the discrepancy, I think, is that the comic was set in the 80s and published in the 80s, while the movie was set in the 80s and released over 20 years later.</p>
<p>If you were one of those folks who read the comic in the 80s, you found yourself tripping out over little ways in which the world of the Watchmen was different than your world, and it was interesting to think about how the people in that world dealt with contemporary issues like the possibility of nuclear holocaust. </p>
<p>In order to update the &#8220;feeling&#8221; of those comics to the world of today, imagine a comic about an alternate world in which Ronald Regan was still president for a sixth term when 9/11 happened, and how people in that world used a government controlled version of Microsoft Windows to spy on civilians.</p>
<p>Having those contemporary touchpoints (e.g., 9/11 and Microsoft Windows in my analogy) was essential, I think, to the feeling of vertigo you got in reading a comic about an alternate universe in which certain things were just different.</p>
<p>In watching a faithful movie 20+ years later, I found that the &#8220;real&#8221; cultural touchpoints (e.g., the birth of MTV, 3 1/4&#8243; floppy disks, and nuclear armageddon) were almost as alien to me as the supposedly &#8220;trippy&#8221; weird stuff (e.g., Gunga Diner)</p>
<p>Perhaps this is just an unsolvable problem. I don&#8217;t think I would want to see a Watchmen movie set in 2009 unless Alan Moore was doing the rewrite. Still, the fact that the movie version of Watchmen was set in a foreign land (the 80s) meant that a lot of the political and cultural questions just didn&#8217;t feel relevant.</p>
<h3>The ending</h3>
<p>Meh. I was actually not a huge fan of the ending in the comic to begin with. It just didn&#8217;t feel plausible to me. The ending in the movie was in exactly the same spirit as the comic, and felt slightly more plausible, but not really. (Everlasting peace? Because these cities got destroyed? Really?) There are perhaps some slightly more interesting questions raised in the movie version of the ending (is fear of Dr. Manhattan akin to fear of God?) but only barely.</p>
<p>So the ending is fine. Meh.</p>
<h3>In a nutshell</h3>
<p>Like I said originally, this is probably the best movie that could have been made, given the circumstances. I&#8217;m a huge fan of the Watchmen (as if that weren&#8217;t already obvious) and it&#8217;s gratifying to see the story be told on a big screen with big production values. I loved the portrayal of Rorschach and the movie Dr. Manhattan was actually <em>better</em> for me than the one in the comic book. The movie didn&#8217;t stray too far from the comic book, and I think that was a good thing.</p>
<p>In my heart of hearts, when I go to a movie like this, I want it to blow my brains out. I want to leave the movie theater in a bit of a daze, my head full of a thousand thoughts, and my eyes not quite sure if the world around me has changed in some subtle way that I can&#8217;t quite perceive. The first Matrix movie did that for me. Mulholland Drive did that for me. This movie didn&#8217;t do that for me, but I wasn&#8217;t expecting it to. Like I said, I enjoyed it for what it is.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2009/03/11/yawr-yet-another-watchmen-review/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Trepidation about Watchmen: can you recapture a moment?</title>
		<link>http://kuwamoto.org/2009/03/11/trepidation-about-watchmen-can-you-recapture-a-moment/</link>
					<comments>http://kuwamoto.org/2009/03/11/trepidation-about-watchmen-can-you-recapture-a-moment/#respond</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Wed, 11 Mar 2009 18:35:52 +0000</pubDate>
				<category><![CDATA[uncategorized]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=237</guid>

					<description><![CDATA[I&#8217;m going to see Watchmen this afternoon, and I&#8217;m nervous. The issue isn&#8217;t whether the movie will suck, or whether it will be faithful to the comic, or whether something will be lost in translation to movie format. The issue for me is that the Watchmen was a moment in time, and that moment can&#8217;t [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m going to see Watchmen this afternoon, and I&#8217;m nervous. The issue isn&#8217;t whether the movie will suck, or whether it will be faithful to the comic, or whether something will be lost in translation to movie format.</p>
<p>The issue for me is that the Watchmen was a moment in time, and that moment can&#8217;t ever be recaptured.</p>
<p>For me, reading the Watchmen was an intensely social experience, much like watching the first season of Twin Peaks or the first season of Lost. As each issue came out, friends would gather and pore over every frame, trying to find clues to what was &#8220;really going on.&#8221; As the pace of the issues slowed down toward the end, the wait was agonizing.</p>
<p>My memory of Watchmen has much more to do with how I felt as each issue came out and much less to do with the actual story.</p>
<p>For those youngsters (or late adopters) who read the Watchmen as a single graphic novel, the experience must have been very different. I&#8217;m sure that the latecomers can still appreciate it, but there is just no way that the experience of reading the whole thing from end to end is in any way similar to the experience of waiting a month between each issue. And the experience of watching the movie will be even less like my memory of the experience of reading the comic.</p>
<p>So that&#8217;s it in a nutshell. In fact, I&#8217;m so afraid of seeing this movie that I even considered not seeing it. We&#8217;ll see if I made the right choice.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2009/03/11/trepidation-about-watchmen-can-you-recapture-a-moment/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Safari 4 First Thoughts</title>
		<link>http://kuwamoto.org/2009/02/25/safari-4-first-thoughts/</link>
					<comments>http://kuwamoto.org/2009/02/25/safari-4-first-thoughts/#comments</comments>
		
		<dc:creator><![CDATA[sho]]></dc:creator>
		<pubDate>Wed, 25 Feb 2009 23:36:47 +0000</pubDate>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[webstandards]]></category>
		<guid isPermaLink="false">http://kuwamoto.org/?p=227</guid>

					<description><![CDATA[Just checked out the Safari 4 beta. Overall, it looks promising. The good JavaScript performance. I&#8217;m curious to know how they accomplished this (JIT compiler?) but I&#8217;m happy it&#8217;s here. More and more, client-side JavaScript is becoming something that can do heavy lifting. Tabbed browsing. The weird tab/title bar doesn&#8217;t appeal to me, but I [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Just checked out the Safari 4 beta. Overall, it looks promising.</p>
<h3>The good</h3>
<p><strong>JavaScript performance.</strong> I&#8217;m curious to know how they accomplished this (JIT compiler?) but I&#8217;m happy it&#8217;s here. More and more, client-side JavaScript is becoming something that can do heavy lifting.</p>
<p><strong>Tabbed browsing.</strong> The weird tab/title bar doesn&#8217;t appeal to me, but I can see its value. To me, the window needs to feel like it&#8217;s a container, and the tabs just screw that up for me. But the space savings is nice.</p>
<p><s><strong>Better keyboard navigation.</strong> Greatly appreciated by those of us who fill out forms on the web. Which is to say everyone.</s> turns out they had this in Safari 3.</p>
<p><strong>Better hints for location bar.</strong> Much better! The hints now work kind of like spotlight. Type stuff into the URL bar, and Safari will do its best to find a matching URL from any source it can think of (history, bookmarks, etc). The best guess is shown first (like Spotlight) and the rest are categorized. <strong>Problems:</strong> The location bar doesn&#8217;t seem to handle page titles, which is a shame. Also, if you mistype a URL and get a 404 or other error, it still shows up in history and can end up as the &#8220;top hit&#8221;. Uh&#8230; whoops!</p>
<p><strong>Embedded web fonts.</strong> It&#8217;s great that Safari is doing this. However, to be realistic (a) more browsers need to support this, and (b) someone needs to sort through all the legal issues having to do with font embedding.</p>
<h3>The meh</h3>
<p><strong>CSS animations.</strong> Back in 97, I was one of the folks working on the first version of Dreamweaver. At that point in time, the Netscape folks were coming up with new tags all the time. </p>
<p>When we told the Netscape folks that we were going to add a timeline to Dreamweaver to take advantage of the &lt;layer&gt; tag, they were surprised and happy. You see, the inspiration for the &lt;layer&gt; tag was this question: &#8220;how can we have the browser do the things that the Shockwave plugin does?&#8221; Fast forward to 2009 and replace &#8220;layer&#8221; with &#8220;CSS animations&#8221; or &#8220;canvas&#8221; and replace &#8220;Shockwave&#8221; with &#8220;Flash&#8221;. </p>
<p>My opinion on all this? Meh. If you want to do everything that Flash does, use Flash. Or invent something radically new that blows HTML out of the water. Don&#8217;t bother bolting that stuff onto HTML/CSS.</p>
<p>In fact, if you&#8217;re going to bolt stuff onto CSS, focus on getting the basics of static presentation right. CSS layout is still incredibly difficult (way harder than tables were). You have to do hours of Google research just to get a usable two column layout.</p>
<p><strong>Top Sites.</strong> The top sites UI feels overly glitzy to me, and for no good reason. The slightly curved appearance implies (to my eye) that I should be able to rotate my view to the left and the right to see more sites. Which you can&#8217;t do, as far as I can tell.</p>
<p><strong>Bookmark Sidebar / Cover Flow.</strong> I like Cover Flow, but it&#8217;s getting to the point where I can&#8217;t tell the Apple apps apart. iTunes has a sidebar on the left, a list of stuff on the right, which can include a Cover Flow view and a list below. Same with the Finder. Same with the browser. Same with&#8230; </p>
<p>Maybe I&#8217;m just thinking about this too abstractly, but it bothers me that so many of the Apple apps are starting to feel the same as each other. Not so long ago, iTunes was different than the Finder, which was different than iPhoto. Now, you have cover flow in the Finder and with Quick Look, you can play the song right from there. </p>
<p>So I don&#8217;t know. I&#8217;m kind of torn. Consistency is nice, but too much consistency leads to every single thing looking exactly the same. It feels a little bit like MS Windows UI right around when XP came out. Tree views were pretty general, and a lot of applications fit into the pattern of &#8220;tree view on left, detail view on right&#8221;, so that&#8217;s what everyone did.</p>
<p>Maybe it will grow on me. Or maybe they&#8217;ll iron out the kinks. (single clicking on a bookmark in the sidebar doesn&#8217;t navigate you to the page. It shows you a &#8220;category&#8221; with a single bookmark in it. Double clicking on the bookmark in the sidebar lets you rename the bookmark. The only way to navigate to that bookmark, as far as I can tell, is to click on the bookmark, and then click on the image of the website in cover flow, or else double click on the bookmark in the bottom pane below cover flow. I mean&#8230; cover flow is pretty, but isn&#8217;t single clicking a bookmark more important?)</p>
<h3>The WTF?</h3>
<p><strong>Color profile support.</strong> They claim to be the <s>first</s> only one to support this, but doesn&#8217;t Firefox already do this? Is the issue that it is turned off by default? Or does Safari handle colors in a significantly better way than Firefox?</p>
]]></content:encoded>
					
					<wfw:commentRss>http://kuwamoto.org/2009/02/25/safari-4-first-thoughts/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
	</channel>
</rss>
