<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Neerav Kumar</title>
	<atom:link href="http://nero.im/feed/" rel="self" type="application/rss+xml" />
	<link>http://nero.im</link>
	<description>The Geek, The Man, The Myth(also an erstwhile member of the Sith)</description>
	<lastBuildDate>Sat, 19 Jan 2013 02:34:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>A Fast URL Shortener</title>
		<link>http://nero.im/a-fast-url-shortener/</link>
		<comments>http://nero.im/a-fast-url-shortener/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 15:26:23 +0000</pubDate>
		<dc:creator>Neerav</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nero.im/?p=281</guid>
		<description><![CDATA[What&#8217;s the use of getting a short domain name if you can&#8217;t make your links even shorter using a URL shortener. The Problem So, I set out to find a URL shortener to integrate into my WordPress. But was disappointed (&#8230;)</p><p><a href="http://nero.im/a-fast-url-shortener/">Read the rest of this entry &#187;</a></p>]]></description>
				<content:encoded><![CDATA[<p>What&#8217;s the use of getting a short domain name if you can&#8217;t make your links even shorter using a URL shortener.<br />
<span id="more-281"></span></p>
<h2><a href="#more">The Problem</a></h2>
<p>So, I set out to find a URL shortener to integrate into my WordPress.<br />
But was disappointed as all of them seem to use MySQL and make 4-5 character identifiers<br />
for URLs. I knew that I would only be shortening URLs for myself and hence didn&#8217;t need such overheads(extra time and characters).</p>
<p>So, I set out to build a really fast URL shortener to suit my needs. I soon came to the realization that a URL shortener is nothing but a key-value store. The key being the URL fragment in the shortened URL and the value being the URL being redirected to. This led me to start my more ambitious project of making the fastest key-value store that I could imagine specifically for the purpose of a URL shortener(I don&#8217;t want to make another <a title="Memcached" href="http://memcached.org/" target="_blank">Memcached</a> or <a href="http://fallabs.com/kyotocabinet/" target="_blank">Kyoto Cabinet</a>).<br />
<span id="solution"></span></p>
<h2><a href="#solution">The Solution</a></h2>
<p>The main and perhaps the only deciding factor for speed of a key-value store is its lookup time and any decent CS grad(whether you believe it or not I am) knows that the data structure offering the best speed for that is <strong>hash table(O(1) lookup)</strong>.</p>
<p>Then, I set out to search for the fastest hash table implementation in C++ known to mankind and <a title="Hash Table Benchmarks" href="http://incise.org/hash-table-benchmarks.html" target="_blank">these benchmarks </a>led me to choose <a title="Dense Hash Map" href="http://google-sparsehash.googlecode.com/svn/trunk/doc/dense_hash_map.html" target="_blank">Dense Hash Map by Google</a>.</p>
<p>I later came across <a title="RDESTL Benchmarks" href="http://msinilo.pl/blog/?p=668" target="_blank">this</a> and <a title="Awesome Comparison" href="http://unbounddeveloper.com/node/15" target="_blank">this</a>(this guy has already done what I am doing now) but I have had no time to port RDESTL to Linux and integrate it to my implementation but its definitely on my TODO list.</p>
<p>But a Hash Table is only as fast as the hash function it uses and as such finding the fastest hash function was not that hard with the most prominent ones listed <a title="Google Performance Notes" href="http://google-sparsehash.googlecode.com/svn/trunk/doc/performance.html" target="_blank">here</a>.</p>
<p>I finally settled on MurmurHash 3 due to the benchmark <a title="MurmurHash 3 benchmark" href="http://code.google.com/p/smhasher/wiki/MurmurHash3#Bulk_speed_test,_hashing_an_8-byte-aligned_256k_block" target="_blank">here</a>.<br />
<span id="result"></span></p>
<h2><a href="#result">So, what was the end result?</a></h2>
<p>The end result is the following <a title="Github Repository" href="https://github.com/neeravkumar/speedshortener" target="_blank">code</a>. The code should be pretty self-explanatory. If its not you know where to find me.<br />
<span id="todo"></span></p>
<h2><a href="#todo">TODO</a></h2>
<ul>
<li><del>Replace Dense Hash Map with <a href="http://code.google.com/p/rdestl/" target="_blank">RDESTL</a></del> DONE!</li>
<li>Embed a <a href="http://www.pion.org/projects/pion-network-library" target="_blank">GET-only HTTP daemon</a> in the code that can listen on 80 and thus serve requests directly.</li>
<li>Make a API for CRUD of URLs <strong>on the fly.</strong></li>
<li>Make a persistence layer on top of the code to insure the state can be restored if the above API is implemented.</li>
<li>Add logging of requests so that the logs can be used for <strong>passive</strong> data collection.</li>
</ul>
<p>I think it sums its up for now. Contributions, criticisms are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://nero.im/a-fast-url-shortener/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hello World!</title>
		<link>http://nero.im/hello-world/</link>
		<comments>http://nero.im/hello-world/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 08:57:47 +0000</pubDate>
		<dc:creator>Neerav</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cherokee.nero.webfactional.com/wordpress/?p=10</guid>
		<description><![CDATA[Titling your first post &#8220;Hello World!&#8221; has to be one of the most over-used cliché in the world. But, writing the first post it gives me a feeling akin to the one which I got when I first wrote my (&#8230;)</p><p><a href="http://nero.im/hello-world/">Read the rest of this entry &#187;</a></p>]]></description>
				<content:encoded><![CDATA[<p>Titling your first post &#8220;Hello World!&#8221; has to be one of the most over-used cliché in the world.<br />
<span id="more-10"></span></p>
<p>But, writing the first post it gives me a feeling akin to the one which I got when I first wrote my &#8220;Hello World!&#8221;  in VB6.</p>
<pre>Private Sub cmdButton_Click()
    MsgBox "Hello, World!"
End Sub</pre>
<p>A bad start I guess(and as many of you know), but truly this blog is one of the few creative works that I have done recently and creating it was as exciting as seeing that message box with &#8220;Hello World!&#8221;.<br />
<span id="why-now"> </span></p>
<h2><a href="#why-now">Why Now?</a></h2>
<ul>
<li>I have lot of ideas. I read a lot and in general share a lot too(if you follow me on Twitter or Buzz you will know)</li>
<li>I have lots of free time and peace of mind to write things due to my awesome employers</li>
<li>Everybody seems to have a blog these days and I don&#8217;t seem to like Tumblr that much.</li>
</ul>
<p><span id="thanks"> </span></p>
<h2><a href="#thanks">Thanks</a></h2>
<ul>
<li>First and foremost my awesome employers i.e <a href="http://webfaction.com" target="_blank">Webfaction</a> who also host this site.</li>
<li><a href="http://fb.com/abinash.pant" target="_blank">Abinash Pant</a> &#8211; My awesome friend who bought this domain for me(of course I am going to pay him back sometime in the near future).</li>
<li><a href="http://www.rodrigogalindez.com/acerca/" target="_blank">Rodrigo Galindez</a> &#8211; The author of this Awe-Inspiring Theme</li>
</ul>
<p>Well then, I am off. Hoping to return with more interesting stuff to write about soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://nero.im/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
