README.md in faster_path-0.3.7 vs README.md in faster_path-0.3.8

- old
+ new

@@ -1,13 +1,13 @@ # 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.6.svg)](https://github.com/danielpclark/faster_path/pulse) +[![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) [![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)](https://coveralls.io/github/danielpclark/faster_path) +[![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. @@ -113,11 +113,11 @@ ``` Add this line to your application's Gemfile: ```ruby -gem 'faster_path', '~> 0.3.6' +gem 'faster_path', '~> 0.3.8' ``` And then execute: $ bundle @@ -127,36 +127,38 @@ $ gem install faster_path ## Visual Benchmarks Benchmarks in Faster Path now produce visual graph charts of performance improvements. -When you run `rake bench` the graph art will be placed in `doc/graph/`. Here's the performance +When you run `export GRAPH=1; bundle && rake bench` the graph art will be placed in `doc/graph/`. Here's the performance improvement result for the `chop_basename` method. ![Visual Benchmark](https://raw.githubusercontent.com/danielpclark/faster_path/master/assets/chop_basename_benchmark.jpg "Visual Benchmark") ## Usage Current methods implemented: |FasterPath Rust Implementation|Ruby 2.5.0 Implementation|Time Shaved Off| |---|---|:---:| -| `FasterPath.absolute?` | `Pathname#absolute?` | 91.9% | -| `FasterPath.add_trailing_separator` | `Pathname#add_trailing_separator` | 31.2% | -| `FasterPath.children` | `Pathname#children` | 13.2% | -| `FasterPath.chop_basename` | `Pathname#chop_basename` | 54.5% | -| `FasterPath.cleanpath_aggressive` | `Pathname#cleanpath_aggressive` | 73.8% | -| `FasterPath.cleanpath_conservative` | `Pathname#cleanpath_conservative` | 70.7% | -| `FasterPath.del_trailing_separator` | `Pathname#del_trailing_separator` | 80.6% | -| `FasterPath.directory?` | `Pathname#directory?` | 11.3% | -| `FasterPath.entries` | `Pathname#entries` | 8.4% | -| `FasterPath.extname` | `File.extname` | 41.2% | -| `FasterPath.has_trailing_separator?` | `Pathname#has_trailing_separator` | 67.6% | -| `FasterPath.plus` | `Pathname#join` | 66.4% | -| `FasterPath.plus` | `Pathname#plus` | 81.4% | -| `FasterPath.relative?` | `Pathname#relative?` | 84.1% | -| `FasterPath.relative_path_from` | `Pathname#relative_path_from` | 69.8% | +| `FasterPath.absolute?` | `Pathname#absolute?` | 95.8% | +| `FasterPath.add_trailing_separator` | `Pathname#add_trailing_separator` | 68.7% | +| `FasterPath.basename` | `File.basename` | 49.4% | +| `FasterPath.children` | `Pathname#children` | 39.2% | +| `FasterPath.chop_basename` | `Pathname#chop_basename` | 76.6% | +| `FasterPath.cleanpath_aggressive` | `Pathname#cleanpath_aggressive` | 78.2% | +| `FasterPath.cleanpath_conservative` | `Pathname#cleanpath_conservative` | 74.1% | +| `FasterPath.del_trailing_separator` | `Pathname#del_trailing_separator` | 87.7% | +| `FasterPath.directory?` | `Pathname#directory?` | 16.8% | +| `FasterPath.dirname` | `File.dirname` | 28.9% | +| `FasterPath.entries` | `Pathname#entries` | 36.1% | +| `FasterPath.extname` | `File.extname` | 66.2% | +| `FasterPath.has_trailing_separator?` | `Pathname#has_trailing_separator` | 86.3% | +| `FasterPath.plus` | `Pathname#join` | 67.9% | +| `FasterPath.plus` | `Pathname#plus` | 86.6% | +| `FasterPath.relative?` | `Pathname#relative?` | 87.2% | +| `FasterPath.relative_path_from` | `Pathname#relative_path_from` | 74.0% | 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 everything everywhere. @@ -174,20 +176,20 @@ FasterPath.sledgehammer_everything! ``` ## Optional Rust implementations -**These are stable, not performant, and not included in `File` by default.** +**These are stable, not performant, and not included in `Pathname` by default.** -These will **not** be included by default in monkey-patches. Be cautious when using the `FasterPath::RefineFile` refinement. To try them with monkeypatching use the environment flag of `WITH_REGRESSION`. These methods are here to be improved upon. +These will **not** be included by default in monkey-patches. To try them with monkeypatching use the environment flag of `WITH_REGRESSION`. These methods are here to be improved upon. |FasterPath Implementation|Ruby Implementation| |---|---| -| `FasterPath.dirname` | `File.dirname` | -| `FasterPath.basename` | `File.basename` | +| `FasterPath.entries_compat` | `Pathname.entries` | +| `FasterPath.children_compat` | `Pathname.children` | It's been my observation (and some others) that the Rust implementation of the C code for `File` has similar results but -performance seems to vary based on CPU cache on possibly 64bit/32bit system environments. When these methods were initially written, and somewhat simplistic, they were faster than the C implementations on `File`. After the implementations have been perfected to match the behavior in Ruby they don't perform as well and are therefore not included by default when the monkey patch method `FasterPath.sledgehammer_everything!` is executed. +performance seems to vary based on CPU cache on possibly 64bit/32bit system environments. These are not included by default when the monkey patch method `FasterPath.sledgehammer_everything!` is executed. ## Getting Started with Development The primary methods to target are mostly listed in the **Why** section above. You may find the Ruby source code useful for Pathname's [Ruby source](https://github.com/ruby/ruby/blob/32674b167bddc0d737c38f84722986b0f228b44b/ext/pathname/lib/pathname.rb),