---
layout: post
title: An Optimization Exercise
date: 2016-04-26
author: kevinmontrose
source: https://kevinmontrose.com/2016/04/26/an-optimization-exercise/
description: My colleague set off a little bit of a benchmarking contest...
tags:
 - engineering
---

Nick Craver tweets out snippets of the Stack Overflow code base occasionally.  About a week ago he showed off a ContainsToken method which has been tuned for performance.  This set off a little bit of a benchmarking contest.

My final attempt (which is among the fastest) ended up using a lot of tricks, which I think may be of general interest – so I’m going to walk through how the code works.

####[View the full post at kevinmontrose.com...](https://kevinmontrose.com/2016/04/26/an-optimization-exercise/)
Add blurb & link to Kevin's optimization post
Add blurb & link to Kevin's optimization post
