Faster tests through overriding defaults

I’m using an excellent piece of abandonware called connect-assets on a project.  It works well and does its job fairly well.  It’s a shame that it’s so neglected.

Yesterday I started to get a staging environment up and going on my project.  Connect-assets wants to serve static assets out via and where I normally prefer to serve static assets out via and which results in a simpler nginx config for serving these static assets.

As I looked through the documentation and code for how to do this, I came across a configure option named “detectChanges” that defaulted to “true” which (as near as I can tell) serially and synchronously stat()ed each file involved for every request.

One of the reasons why I’m doing development in node.js/express is because it’s leaps and bounds faster than doing ruby on rails.  My test suite (including integration specs) takes ~3.3 seconds from execution to completion (including compilation, etc.) on my shiny new workstation.  After overriding the default of “detectChanges” my suite takes ~2.6 seconds.

Yay!  🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s