Friday, May 30, 2008

McDonald's Proof

Finished my first real week of work. It was pretty good actually. We're basically just slogging though cases in the typechecker, if you know what that means.

What is up with these commercials for McDonald's new Southern Style Chicken sandwich? They make it seem like they are out to change the world or something. It's an obvious attempt to copy Chick-Fil-A's delicious chicken sandwich which cannot be topped. The commercials are so humorously over the top that I think it's an Army commercial until they mention chicken.

Saw Indiana Jones last night at the Alamo Drafthouse. As far as I can tell everyone in Austin knows and loves the Alamo Drafthouse because everyone I have met here has told me about it. They serve full meals to your seat, and have a great selection of beer. It was unsurprisingly great! If the same thing existed in Los Angeles, the dinner would cost seventy dollars.

Wednesday, May 28, 2008

I'm Going Mobile!

Finally got my car today! It was two days and then three hours late, and covered in hydraulic fluid, but at this point I am totally happy to have it.

I was actually wondering how they were going to transport it. Well it turns out they used one of those 8 car trucks that you usually see rolling down the highway with brand new Chevys. It was kind of funny to see my busted car up there with all these other nice and new-looking cars. Also, my car was all the way up at the front, so the guy had to spend like 10 minutes moving the different levels up and out of the way so that my car could be driven out. The whole thing was rocking back and forth from side to side which made me reconsider the part of the sidewalk I was standing on. Finally he drove it off, at which point, because it was facing backwards on the truck, I had to drive it the wrong way down the street for like 100 yards or something. Lol.

Monday, May 26, 2008

Life Update

One of the most disturbing developments in my life recently has been a recurring "Terminator" dream. In this dream, Terminators are constantly being sent back in time to kill me. The problem with terminators from the future is that no matter how many of them you destroy (and of course, destroying them is really, really hard), there are always more being sent from the future, as machines in the future have the benefit of 20/20 hindsight.

This of course leads to a dream that can potentially run on until I wake up, and is very disturbing. Damn you Terminators.

Sunday, May 25, 2008


Well I never really talked much about my trip to Massachusetts, and I don't think I will now, except to say that I am back. I went to Burlington (like 30 minutes away from Boston) for three days of introductory project meetings. There were lots of talks about Fortress, the language, and I even reported my first bug. Awesome.

Also fun was today's trip to Six Flags. It's down in San Antonio, so I drove with two other interns for like an hour and a half to get there. It was absolutely ridiculously hot, but I've passed that stage in my life where I am too cool for sunscreen, so I think I basically made it out okay.

I'm still pretty funny at theme parks, even at 25. I am constantly walking excitedly in front of the rest of the group, leading us to the next ride. I feel the need to "get my money's worth," by riding as many rides as possible without much down time, but I am starting to realize how unnecessary that attitude is. Today without trying too hard, we rode 10 rides, and we were there from 11 to 7. That sounds okay right? I think I was basically just happy to be outside...

Monday, May 19, 2008

First Day!

Whoa! It was my first day!

Except for getting up really freaking early to rent a car, today was great. We had some teleconferences with the folks in Boston, and then there was a bunch of paperwork, but it was also pretty neat setting up my computer, installing Fortress and getting my new computer.

Tomorrow I'm going to Boston!

Saturday, May 17, 2008

Austin City Litmus

So I'm in Austin! I got here this morning at about 10:30am.

If you didn't know, I'm going to be working in Austin, TX this summer on Project Fortress. Fortress is a programming language designed to be a sort of successor to Fortran, but really it's more like a cool general purpose language that happens to be good for high performance computing applications. I'm going to be doing some optimizations (I think?) to help them get their compiler stuff up and off the ground. I'm working for Sun, and so far even though I haven't started working there yet, they've been extremely nice to me.

I am currently in my new corporate apartment. The downside is, it's not really all that close to downtown, but that's about it. Everything else is really nice. I'm close to where I'll be working. There's a nice kitchen, bedroom, TV and working space, so I really think it's been great of them.

Oh, one more nice thing about the project: Fortress is an open-source project, so presumably I'll actually be able to tell you a lot about what I'm doing on a day-to-day basis (at least, as much as is interesting). Moreover, I'll probably be encouraging you to download tools and other neat things I find out about.

Okay, more when I get to it! Today I'm kind of stuck in my apartment since I don't have my car yet, but tomorrow I'll be visiting some family, and Monday is the first day!

Friday, May 16, 2008

Last Minute Rock Announcement

Tonight Sick Ridiculous and the Sick Ridiculous will be playing at George's graduation party. I won't give out the information here, but email/text/message me for the infos. 9pm start, 10pm rock.

Thursday, May 15, 2008

Austria Recap

Originally uploaded by DixiePistols.
I thought I'd give a little recap on my trip to Austria, complete with pictures. Overall the trip was great. I just got back last night, and everything went pretty well except for this cold I got a earlier this week.

Vienna is know for a couple neat things, like the Hapsburgs, Coffee, Cakes, and music. We spent a lot of time checking out palaces and museums in the city. Vienna is also known for an old-style Ferris Wheel, known as the Riesenrad which Kevin called, "the most romantic location in Europe," or something like that.

We also went to Salzburg for a day on Saturday. Salzburg is a little bit more touristy than Vienna, but smaller so the effect is more pronounced. Salzburg literally means "Salt Town," because there was a big salt mine there. Pretty rad huh? It was also the birthplace of Mozart.

Monday, May 12, 2008

Curious Non-Postings

Strangely, I haven't posted in a while. This is mainly strange because I have tons of things going on right now, each one of which might make an excellent blog-o-story. I am currently sitting in an apartment in Vienna, where I have traveled to meet Brianne. Vienna is amazing. Details and pictures, as always to follow. I have a new program, Adobe Photoshop Lightroom, and I am using it to make my pictures (hopefully) much rad-er. I am also now extremely interested in a.) The Hapsburgs b.) Kaiser Franz Joseph c.) World War I and d.) Currywurst.

I also had a paper accepted to a major conference, and that makes me super jazzed. The conference is called OOPSLA, The Conference on Object Oriented Programming Languages, Systems, and Applications. It will be in Nashville this fall. It was on my research work, but was done jointly with Kevin and Jonathan. I don't really have a copy up on the web yet, but I will put one up soon. Seriously. It was called, Verifying Correct Usage of Atomic Blocks with Typestate.

I've also finished reading a great book called A Nervous Splenor: Vienna 1888-1889. It's all about two amazing years in the history of Vienna,  culminating in the suicide of Rudolph, the crown prince. It's history, but reads more like a novel.

Um, more to come... It's dinner time.

Friday, May 2, 2008

The Surprising Performance Implications of .iterator()

This week I discovered a "gotcha" in the Java language that goes into the 'performance' pile, rather than the 'unusual behavior' pile. It has to do with iterators.

See I've been working on this implementation of Software Transactional Memory in Java, and the performance was pretty slow. Now I'm not really a run-time guy, so this fact normally wouldn't bother me, but it was slow enough that a static optimization that I developed was getting lost in the noise. So I busted out the old profiler to see what was slowing things down. I immediately discovered that our code was spending a lot of time iterating over sets, or at least that's how I first interpreted the results. And this made since to me. The run-time uses tons of sets; read sets, write sets, undo sets. And every time a transaction aborts or commits, we're iterating over lots of them, like so:

for( TxnRecord txn_rec : writeSet ) {
  // do something

Seems normal enough. So I replace the HashSet implementation with a LinkedHashSet, which should improve iteration performance. I was a little surprised when this improved the performance not one bit. Then I looked at the profiler results again and realized the following: It wasn't "next()" or "hasNext()" taking all the time, which would indicate slow iteration, it was the actual call to the "iterator()" method, which Java5's enhanced for loops call behind the scenes.

After investigating the implementation of LinkedHashSet I realized something surprising. For empty sets, a call to the "iterator()" method allocates at least two new objects, one for the new keySet of the underlying HashMap, and one for the iterator object itself. All this for an empty set. It turns out that my code was absolutely full of empty sets, since most objects aren't modified in a transaction and their write and undo sets are empty. If you have enough empty sets, this allocation adds up over time. By replacing the above code with:

if( !writeSet.isEmpty ) {
  for( TxnRecord txn_rec : writeSet ) {
    // do something

The overall running time of the benchmark went from ~11secs to ~7secs!

This is bad, because iterating over empty collections should essentially have no run-time cost. Looking at the Java implementation, it would be easy to have some kind of singleton, "empty iterator" object that the HashSet's iterator would return if the set were empty. For example:

iterator() {
  if( size() == 0 ) return Collections.<Iterator<T>>emptyIterator();
  else return map.keySet().iterator(); // This is what it currently says.

This singleton iterator could then always return false when "hasNext" is called. The only reason why this might not be acceptable is if there is some rule about iterators needing to reflect subsequent "add" operations to their underlying collection, but honestly that would seem a little strange of a requirement. At the very least, the singleton iterator could hold a pointer to the original collection and continue to call size() after its creation...

Josh Block, are you listening?