Ag: Very fast grep replacement
Ag
(aka "the silver searcher") is a very fast replacement for grep
.
It will parse your .gitignore
for additional speedup. To ignore even more files (node_modules
, *.min.js
etc), add an .ignore
with syntax identical to .gitignore
.
See Faster Grepping in Vim Show archive.org snapshot for hints about vim integration.
Related cards:
Reprocess only missing images with Paperclip
When a paperclip attachment gains a new style and you have many attachments, reprocessing can take ages. This is because all styles are being recomputed.
To create only missing images, patch Paperclip like this in your script that does the reproc...
has_many :bugs, :through => :rails: Make your shoulda tests faster with fast_context
decided to go fixtureless with Shoulda + Factory Girl. All good, except one problem. Slow as fuck tests. So here’s fast_context as a solution for it. fast_context compiles all the ‘should’s within a context into a single test.
Bundler 1.1 has been released, is very fast
Bundler 1.1 has been released. With this version you no longer need to wait for this:
Fetching source index…
The new Bundler is smarter and can fetch required meta...
RSpec: How to aggregate failures
RSpec >= 3.3 added aggregate_failures, which allows multiple failures in an example and list them all, rather than abortin...
Configuring User Agents with Capybara + Selenium Webdriver
A while ago we were working on an application that had an entire version specially created for mobiles, such as the iPhone. This specific application was entirely tested with Capybara, Steak and Selenium Webdriver. Although the test suite wasn’t t...
How to speed up JSON rendering with Rails
I was recently asked to optimize the response time of a notoriously slow JSON API endpoint that was backed by a Rails application.
While every existing app will have different performance bottlenecks and optimizing them is a rabbit hole of arbitra...
The WordCount Simulation
So this is the simulation that I use in my Agile Testing class, as well as in other contexts where I want to teach lessons about increasing Agility. The mechanics of the simulation itself are very general: the simulation models the organization of...
Keeping web applications fast
Our applications not only need to be functional, they need to be fast.
But, to quote Donald Knuth,
premature optimization is the root of all evil (or at least most of it) in programming
The reasoning is that you should not waste your time op...
ActiveRecord: Creating many records works faster in a transaction
When you need to insert many records into the same table, performance may become an issue.
What you can do to save time is to open a transaction and save multiple records within that transaction:
transaction do
500.times { Model.create!...
Speed up large Cucumber test suites
Test suites usually grow over time as more and more development time is spent on a projects. Overall run-time and performance of Cucumber suites in turn increases, too.
You can use the very same way Henning [suggested for speeding up RSpec](https...