Wednesday, December 17, 2008

Saturday, December 13, 2008

answers.yahoo.com

I am under the impression that there are MORE products that people care about than people who care enough to review products (professionally). Example: I want to know how the PERFORMANCE of an AMD 4450e compares to the older AMD 6000+ (which has the higher product number). Should I trust the product number? Yes in that case, but how do I compare an ATI 3870 vs an ATI 4670?

When product-line-explosion creates review problems you basically have to go to a forum, Amazon customer reviews, or something like answers.yahoo.com. Still, I find many questions unanswered. Maybe there is still a need to just go into a store and ask for some advice (if only the associates where helpful and unbiased).

Anyway, I found it amusing that people use answers.yahoo.com to answer HotOrNot-like questions:

http://answers.yahoo.com/question/index;_ylt=AmHWfryoIcwqCrVw05k8OCQSxgt.;_ylv=3?qid=20081213163120AACAgkV

GM + ads + guitar

My co-advisor and officemates had a lengthy, multi-part debate Friday about GM, the bailout, the environment, and ads.

Btw, I also got a guitar on Friday.

Anyway, the thought that came to mind is that GM's commercial during the '08 Olympics were great. This despite the fact that it didn't make me want to buy a GM car. What it did make me want to buy was a Brandi Carlile CD (the ad used her song "The Story"). I saw a similar pattern in 2007, where an Old Navy ad had a catchy song that I wanted to buy, but I had no immediate interest in the sweaters they were selling.

Ads these days actually promote more than one product and more than one brand. I wonder if they ever pool money together and share the cost of the ad instead of having one party pay the other to license their work. I guess the common case is General Megacorp + Starving Musician. In the past it was harder to Joe S. to identify Starving Musician from the ad and purchase a CD. These days, you can just do a Google search. I don't know if it makes sense for GM to pay SM when SM didn't even need to customize the work for the ad.

Anyway it probably doesn't matter (peanuts compared to, say, $14 billion dollars).

Wednesday, April 2, 2008

Annotations, and No such thing as a stupid response?

I recently came upon an article Abstraction Penalties, Stack Allocation And Ownership Types when looking for uses of ownership types in C. It's an interesting article, and does highlight some of the problems w/ compiler optimizations: you never know when it doesn't do an optimization that it should be able to do.

The primary problem is that escape analysis is expensive and fragile and compilers don't do it very well. A secondary problem is that if you change your program so that escape analysis no longer works, the only way to tell is that your performance gets mysteriously worse.

Of course, it would be a nightmare to see every failed optimization, but it would be nice to know when it matters. I think his take on the problem is to allow annotations for critical code so that the compiler either
  1. successfully optimizes
  2. fails to optimize but shows a counterexample
Of course, you still have some problems
  1. You have to identify the bottlenecks
  2. You have to realize that the bottleneck can be fixed w/ optimization X that can be done if only the compiler knew about Y (assuming the code generation is at fault in the first place).
  3. What if the problem isn't one bottleneck, but many? Every time pattern A, pattern B, ..., and/or pattern Z shows up in your code, the compiler treats it conservatively.
  4. You raise the bar for a standard-compliant compiler. Sure, you already expected a decent compiler to do the requisite static analysis + optimization, but now programmers expect it to respond to the annotations (when previously it silently skipped the optimization).
  5. The code becomes hideous (maybe not so bad w/ an IDE or nice text editor). The annotations go w/ every declaration (class, field, and function signatures) and object instantiation.
For things like pre-conditions and post-conditions, you can "modularize" the annotations (define a condition somewhere and say the function requires the same condition), but if the annotation is supposed to go along w/ every declaration, what can you do?

Well his idea (and an idea used in Cyclone and probably others?) is to have sane defaults (if the annotation isn't present assume X), along with some inference. Of course, now you have to modify old code that doesn't conform to the defaults, but I guess those folks can just use a different mode of the compiler?

Overall it really does seem like what Robert wants is regions (his annotations are very similar to the region annotations, hierarchy of lifetimes, defaults, etc.), but he wants to extend it to data structure hierarchies (If my stack internally is represented by a list, the list does not outlive the stack) and allow better optimizations. Also, he had a cool suggestion of allowing casts (which in a region framework would copy the data to the other region).

Anyway, I got a laugh out of one of the responses to the blog post:

XXXXX: Your assumptions are all wrong... that's what java will be doing. It already infers 'escape detection'...

You should read up on 'eden' garbage collection systems. This is basically how it works: ... The 'eden' system has one heap page where ALL new objects are created. Everytime eden is full, each object in eden that is *STILL* accessible from some place is copied over to the real heap...
And Robert's reply:

You clearly haven't read what I wrote. And why don't you use the term "copying collector" like the rest of the world?

Monday, March 31, 2008

No such thing as a stupid blog post?

We've all heard our teachers say, "Don't worry, there's no such thing as a stupid question!". Well I wonder if the same applies to blog posts. I recently came upon a blog post about what great software should have. The intro was over 1 page long, and I'm sure the whole thing could have been a 10 page paper. Needless to say, I didn't really read it, but thanks to the bold font, I picked up a few points:
  • The guy is impressed with OSes, Emacs, Firefox, and the JVM
  • The guy is not impressed with console games
  • His #1 criterion for great software is that software should not require reboot
  • He notices that all great software come with a command line shell
I am impressed by some of the same software, but I don't think they are at the level that he thinks they're at. Firefox did not fit the "does not require reboot" criterion until recently (memory leaks and fragmentation). Also, I think you could beat most of the Mario games in one sitting if you wanted (and you had to for the NES ones)...

Anyway, I don't think it's bad. Just like a stupid question, it stirred up some discussion (I think he had 96 responses).