Testing various algorithms and techniques for optimization with JavaScript