Friday, September 30, 2011

Dear Google: I Want My Threads Back

I generally like Google. They make nice things. But sometimes they drive me nuts tying to protect me from me.

Consider this picture:

I Want My Threads Back

You can see with naked eye that memcache requests are lined up one after another. Yes, indeed, values stored in memcache are values in the collection, for which I have the keys. It doesn't make sense to group values under one memcache key. And it is a no-brainer candidate for parallelism, with standard Java tools.

But no, you can't. Google said so. It's for your own good. Go use Task Queues instead.

But wait, I don't want to. Task queues are not good enough for my purpose, which is simple - collect data from either memcache or datastore into local application memory. Task queue overhead is way too high for this, and requires to add the insult of double serialization to the injury of memcache being not too fast to begin with.

I simply don't believe that the team that pulled off creation of GAE is incapable of creating a sane thread insulation model that will withstand abuse and stupidity.

I believe that the lack of governed thread model was one of fundamental shortcomings of J2EE specification. It would be really cool if GAE could take it one step forward and provide one.

No comments:

Post a Comment