Benchmarking Autocompeter

12 April 2015   0 comments   Go

Powered by Fusion×

Now that Autocompeter.com is launched I can publish some preliminary benchmarks of "real" usage. It's all on my MacBook Pro on a local network with a local Redis but it's quite telling that it's pretty fast.

What I did was I started with a completely empty Redis database then I did the following things:

First of all, I bulk load in 1035 "documents" (110Kb of data). This takes about 0.44 seconds consistently!

  1. GET on the home page (not part of the API and thus quite unimportant in terms of performance)
  2. GET on a search with a single character ("p") expecting 10 results (e.g. /v1?d=mydomain&q=p)
  3. GET on a search with a full word ("python") expecting 10 results
  4. GET on a search with a full word that isn't in the index ("xxxxxxxx") expecting 0 results
  5. GET on a search with two words ("python", "te") expecting 4 results
  6. GET on a search with two words that aren't in the index ("xxxxxxx", "yyyyyy") expecting 0 results

In each benchmark I use wrk with 10 connections, lasting 5 seconds, using 5 threads.

And for each round I try with 1 processor, 2 processors and 8 processors (my laptop's max according to runtime.NumCPU()).

I ran it a bunch of times and recorded the last results for each number of processors.
The results are as follows:

Autocompeter Benchmark v1

Notes

Basically, this is a benchmark of Redis more so than Go but it's quite telling that running it in multiple processors does help.

If you're curious, the benchmark code is here and I'm sure there's things one can do to speed it up even more. It's just interesting that it's so freakin' fast out of the box!

In particular I'm very pleased with the fact that it takes less than half a second to bulk load in over 1,000 documents.

Comments

Thank you for posting a comment

Your email will never ever be published


Related posts

Previous:
Match the whole word in auto complete maybe 10 April 2015
Next:
AngularJS $q notify and resolve as a local GET proxy 18 April 2015
Related:
Autocompeter is Dead. Long live Autocompeter! 09 January 2017
A quicksearch for Bugzilla using Autocompeter 27 January 2016
Match the whole word in auto complete maybe 10 April 2015
django-fancy-cache with or without stats 11 March 2013
Optimization of getting random rows out of a PostgreSQL in Django 23 February 2011
Local Django development with Nginx 11 October 2010
To $('#foo p') or to $('p', $('#foo')) 24 February 2009
rfc822() vs. rfc1123_date() 16 August 2007
Gzip and Slimmer optimization anecdote 30 January 2007
Fastest way to uniqify a list in Python 14 August 2006