README.md in faster_path-0.3.9 vs README.md in faster_path-0.3.10

- old
+ new

@@ -1,16 +1,15 @@ # FasterPath [![Gem Version](https://badge.fury.io/rb/faster_path.svg)](https://badge.fury.io/rb/faster_path) [![TravisCI Build Status](https://travis-ci.org/danielpclark/faster_path.svg?branch=master)](https://travis-ci.org/danielpclark/faster_path) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/10ul0gk3cwhlt2lj/branch/master?svg=true)](https://ci.appveyor.com/project/danielpclark/faster-path/branch/master) [![Latest Tag](https://img.shields.io/github/tag/danielpclark/faster_path.svg)](https://github.com/danielpclark/faster_path/tags) -[![Commits Since Last Release](https://img.shields.io/github/commits-since/danielpclark/faster_path/v0.3.8.svg)](https://github.com/danielpclark/faster_path/pulse) +[![Commits Since Last Release](https://img.shields.io/github/commits-since/danielpclark/faster_path/v0.3.10.svg)](https://github.com/danielpclark/faster_path/pulse) [![Binary Release](https://img.shields.io/github/release/danielpclark/faster_path.svg)](https://github.com/danielpclark/faster_path/releases) [![Coverage Status](https://coveralls.io/repos/github/danielpclark/faster_path/badge.svg?branch=master)](https://coveralls.io/github/danielpclark/faster_path?branch=master) [![Inline docs](http://inch-ci.org/github/danielpclark/faster_path.svg?branch=master)](http://inch-ci.org/github/danielpclark/faster_path) [![Code Triagers Badge](https://www.codetriage.com/danielpclark/faster_path/badges/users.svg)](https://www.codetriage.com/danielpclark/faster_path) -[![Tweet This](https://raw.githubusercontent.com/danielpclark/faster_path/master/assets/tweet.png)](https://twitter.com/share?url=https%3A%2F%2Fgithub.com%2Fdanielpclark%2Ffaster_path&via=6ftdan&hashtags=Ruby&text=You%20could%20save%2015%25%20or%20more%20on%20website%20page%20load%20time%20by%20switching%20to%20the%20FasterPath%20gem.) #### This gem shaves off more than 30% of my Rails application page load time. The primary **GOAL** of this project is to improve performance in the most heavily used areas of Ruby as path relation and file lookup is currently a huge bottleneck in performance. As this is the case the @@ -92,10 +91,22 @@ |:---:|:---:| |sprockets 2.12.4|sprockets 3.6| |sass 3.2.19|sass 5.0.4| |bootstrap-sass 3.3.4.1|bootstrap-sass 3.3.6| +## Performance Specifics + +The headline for the amount for improvement on this library is specific to only the improvement made with the method `chop_basename`. Just so you know; in my initial release I had a bug in which that method immediately returned nothing. Now the good thing about this is that it gave me some very valuable information. First I found that all my Rails site tests still passed. Second I found that all my assets no longer loaded in the website. And third, and most importantly, I found my Rails web pages loaded just more than 66% faster without the cost of time that `chop_basename` took. + +**That's right; the path handling for assets in your website \*consumes more than 2/3rds of your websites page load time.** + +So now we have some real numbers to work with We can be generoues and use 66% as our margin of area to improve over _(for `chop_basename` specifically, not counting the benefit from improving the performance in other file path related methods)_. That means we want to remove as much of that percentage from the overall systems page load time. The original headline boasts over 33% performance improvement — that was when `chop_basename` was improved by just over 50%. Now `chop_basename` is improved by 83.4%. That alone should make your site run 55.044% faster now _(given your performance profile stats are similar to mine)_. + +## What Rails Versions Will This Apply To? + +As mentioned earlier Sprockets, which handles assets, changed away from using `Pathname` at all when moving from major version 2 to 3. So if you're using Sprockets 3 or later you won't reap the biggest performance reqards from using this gem for now _(it's my goal to have this project become a core feature that Rails depends on and yes… that's a big ask)_. That is unless you write you're own implementation to re-integrate the use of `Pathname` and `FasterPath` into your asset handling library. For now just know that the Sprockets 2 series primarily works with Rails 4.1 and earlier. It may work in later Rails versions but I have not investigated this. + ## Status * Rust compilation is working * Methods are stable * Thoroughly tested @@ -113,11 +124,11 @@ ``` Add this line to your application's Gemfile: ```ruby -gem 'faster_path', '~> 0.3.8' +gem 'faster_path', '~> 0.3.10' ``` And then execute: $ bundle @@ -151,12 +162,12 @@ | `FasterPath.directory?` | `Pathname#directory?` | 6.4% | | `FasterPath.dirname` | `File.dirname` | 55.4% | | `FasterPath.entries` | `Pathname#entries` | 41.0% | | `FasterPath.extname` | `File.extname` | 63.1% | | `FasterPath.has_trailing_separator?` | `Pathname#has_trailing_separator` | 88.9% | -| `FasterPath.plus` | `Pathname#join` | 72.0% | -| `FasterPath.plus` | `Pathname#plus` | 87.7% | +| `FasterPath.plus` | `Pathname#join` | 79.1% | +| `FasterPath.plus` | `Pathname#plus` | 94.7% | | `FasterPath.relative?` | `Pathname#relative?` | 92.6% | | `FasterPath.relative_path_from` | `Pathname#relative_path_from` | 93.3% | You may choose to use the methods directly, or scope change to rewrite behavior on the standard library with the included refinements, or even call a method to monkeypatch @@ -202,11 +213,9 @@ Rust method like `!absolute?` _(not absolute)_ drops 39% of the performance already gained in Rust. Whenever feasible implement it in Rust. After checking out the repo, make sure you have Rust installed, then run `bundle`. Run `rake test` to run the tests, and `rake bench` for benchmarks. - -Learn and share performance tips on the [wiki](https://github.com/danielpclark/faster_path/wiki)! ### Building and running tests First, bundle the gem's development dependencies by running `bundle`. Rust compilation is included in the current rake commands.