JSON vs Thrift vs PBuffer

April 18, 2009 § Leave a comment

Initially I want to write a simple profile tests to find out, but I found this question on StackOverflow. Which lead to these:

  1. http://bouncybouncy.net/ramblings/posts/thrift_and_protocol_buffers/
  2. http://bouncybouncy.net/ramblings/posts/more_on_json_vs_thrift_and_protocol_buffers/
  3. http://bouncybouncy.net/ramblings/posts/json_vs_thrift_and_protocol_buffers_round_2/

Conclusion:

JSON wins since it is cross-platform and fast enough. But, protocol buffer is interesting since the size of binary data is small.

Now it’s time to profile all available json libraries in Python world.

Python: Drinking the Tokyo Kool-Aid

April 16, 2009 § 1 Comment

After reading what LightCloud can do, of course, it’s only natural to create object that serialized to Tokyo.

And that exactly what I did. The project (called Hail) is still infant, but the profile tests already answers some of my questions and curiosity about LightCloud (and Tokyo).

One obvious weakness I need to tackle: Serializing is too slow.

Questions that got answered:

  • Slowness is not caused by the size of the object, instead it is caused by number of items.
  • LightCloud does execute a lot of function calls. Most of the are really fast though.
  • EDIT: Tokyo is fast! Especially after I compare it with Memcache. But LightCloud is not. Tokyo is not as fast as I thought… but this is not final thought, I should create profile_test on raw tokyo tyrant node. On top of that LightCloud overhead is not negligible.
  • Serializing to cjson is faster than cPickle. That’s surprising.

Next, I should test getting items from both memcache and tokyo. I’m expecting it to be really fast.

References:

Git Cheat Sheet

April 11, 2009 § 1 Comment

A couple of notes for myself and readers about Git:

  • Git does not allow you to add empty directory.
  • Do not forget to do initial commit when starting a new repository. Otherwise you will get: error: src refspec master does not match any. Reference: here.
  • There are a couple of configurations need to be set before performing git pull:
    git config branch.master.merge 'refs/heads/master' and 
    git config branch.master.remote 'origin'
    
  • How to ignore files? Read here.
  • The best Git GUI on OS X is: GitX.
  • Git cheat sheet by GitHub: [link]

If you are SVN users:

  • git checkout is not what you think. The functionality that you might want is git clone.
  • git checkout is used to switch branch or re-checkout a file.
  • git commit is not what you think. The command only do local commit. To push to ‘central‘ repo, you want to do git commit followed by git push.

Javascript on Firefox 3 Slice Bug

April 5, 2009 § 3 Comments

See the code below:

container = ['localhost:8080', 'aaaaaaaaa', 'history']
for(var i in container)
{
console.log(container[i]);
console.log(container.slice(0,i+1));
}

The Firebug output is below:

localhost:8080
["localhost:8080"]
aaaaaaaaa
["localhost:8080", "aaaaaaaaa", "history"]
history
["localhost:8080", "aaaaaaaaa", "history"]

Notice the problem there? When i == 1, why slice() output is not:
["localhost:8080", "aaaaaaaaa"] ??????

I cannot explain why this is happening and yes… I have refreshed my browser multiple times.

Reference:

Mozilla Developer Center :: Slice

Beards of Python

April 4, 2009 § Leave a comment

I believe these are PyCon09 attendants.

Almost Perfect: The rise and fall of Word Perfect

April 4, 2009 § Leave a comment

You can read the book here.

alexa…

April 1, 2009 § Leave a comment

Wow, after the new redesign, Alexa is just terrible.

It loads slowly and some of the ranks changed. It makes me wonder, why the ranks changed? Did they also change the algorithm?

Where Am I?

You are currently viewing the archives for April, 2009 at RAPD.

Follow

Get every new post delivered to your Inbox.