Author Archives: brucedawson

About brucedawson

I'm a programmer, working for Google, focusing on optimization and reliability. Nothing's more fun than making code run 10x faster. Unless it's eliminating large numbers of bugs. I also unicycle. And play (ice) hockey. And juggle.

Sometimes Floating Point Math is Perfect

I’ve written in the past about how to compare floating-point numbers for the common scenario where two results should be similar but may not be identical. In that scenario it is reasonable to use an AlmostEqual function for comparisons. But … Continue reading

Posted in Floating Point | Tagged | 2 Comments

Commute Challenge 2017

I’m lucky enough to live just 2 km (1.25 miles) away from the place where I work. Because of this – and because I dislike driving – I tend to commute in a variety of non-car ways. A few months … Continue reading

Posted in Commuting, Environment | Tagged , | 6 Comments

Traveling in Iran

In 1992, near the end of a very slow trip around the world, my fiancée (now wife) and I visited Iran for two weeks. I thought I’d share a few pictures and stories from that visit. We entered Iran through … Continue reading

Posted in Travel | Tagged , , , , | 8 Comments

Delete an inline function, save 794 kB

In the previous episode of “Simple Changes to Shrink Chrome” I discussed how deleting ‘const’ from a few key locations could lead to dramatic size savings, due to a VC++ compiler quirk. In this episode I’ll show how deleting an … Continue reading

Posted in Performance, Programming, Visual Studio | Tagged , , | 13 Comments

Add a const here, delete a const there…

I just completed a series of changes that shrunk the Chrome browser’s on-disk size on Windows by over a megabyte, moved about 500 KB of data from its read/write data segments to its read-only data segments, and reduced its private … Continue reading

Posted in Performance, Programming, Visual Studio | Tagged , , | 28 Comments

Seattle to Portland on a Unicycle

This was originally written in the summer of 2005. I’m reposting it here to get all my writing in one place. For more information on long-distance and high-speed unicycling go to the unicycle section of my blog, available here. The … Continue reading

Posted in Unicycling | Tagged , , , | 2 Comments

VC++ /arch:AVX option – unsafe at any speed

Microsoft’s VC++ compiler has an option to generate instructions for new instruction sets such as AVX and AVX2, which can lead to more efficient code when running on compatible CPUs. So, an obvious tactic is to compile critical math-heavy functions … Continue reading

Posted in Programming, Visual Studio | Tagged , , , , | 31 Comments