README.md in faster_path-0.0.3 vs README.md in faster_path-0.0.4
- old
+ new
@@ -1,23 +1,61 @@
# FasterPath
+[![Gem Version](https://badge.fury.io/rb/faster_path.svg)](https://badge.fury.io/rb/faster_path)
+[![Build Status](https://travis-ci.org/danielpclark/faster_path.svg?branch=master)](https://travis-ci.org/danielpclark/faster_path)
-This project "WILL BE" a rewrite of Ruby's STDLIB **Pathname** optimized for speed and performance.
-I am considering making it a \*nix OS gem, but that may likely just be an early phase. Windows support
-can be added much later.
+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
+path performance updates will likely not be limited to just changing the Pathname class but also will
+be offering changes in related methods and classes.
-The primary **GOAL** of this project is to improve performance in the Rails environment as path relation
-and file lookup is a huge bottleneck in performance. As this is the case the path performance updates
-will likely not be limited to just changing Pathname but also will be offering changes in related methods
-and classes.
-
Users will have the option to write their apps directly for this library, or they can choose to either
-refine or monkeypatch the existing library. Refinements are narrowed to scope and monkeypatching will
+refine or monkeypatch the existing standard library. Refinements are narrowed to scope and monkeypatching will
be a sledge hammer ;-)
**NOTE**: Refinements and monkeypatch methods are highly likely to be changed and renamed pre version
0.1.0 so keep that in mind!
+## Why
+
+I did a check on Rails on what methods were being called the most and where the application spend
+most of its time. It turns out roughly 80% _(as far as I can tell)_ of the time spent and calls made
+are file Path handling. This is shocking, but it only gets worse when handling assets. **That is
+why we need to deal with these load heavy methods in the most efficient manner!**
+
+Here's a snippet of a Rails stack profile with some of the most used and time expensive methods.
+
+```
+Booting: development
+Endpoint: "/"
+ user system total real
+100 requests 26.830000 1.780000 28.610000 ( 28.866952)
+Running `stackprof tmp/2016-06-09T00:42:10-04:00-stackprof-cpu-myapp.dump`. Execute `stackprof --help` for more info
+==================================
+ Mode: cpu(1000)
+ Samples: 7184 (0.03% miss rate)
+ GC: 1013 (14.10%)
+==================================
+ TOTAL (pct) SAMPLES (pct) FRAME
+ 1894 (26.4%) 1894 (26.4%) Pathname#chop_basename
+ 1466 (20.4%) 305 (4.2%) Pathname#plus
+ 1628 (22.7%) 162 (2.3%) Pathname#+
+ 234 (3.3%) 117 (1.6%) ActionView::PathResolver#find_template_paths
+ 2454 (34.2%) 62 (0.9%) Pathname#join
+ 57 (0.8%) 52 (0.7%) ActiveSupport::FileUpdateChecker#watched
+ 760 (10.6%) 47 (0.7%) Pathname#relative?
+ 131 (1.8%) 25 (0.3%) ActiveSupport::FileUpdateChecker#max_mtime
+ 88 (1.2%) 21 (0.3%) Sprockets::Asset#dependency_fresh?
+ 18 (0.3%) 18 (0.3%) ActionView::Helpers::AssetUrlHelper#compute_asset_extname
+ 108 (1.5%) 14 (0.2%) ActionView::Helpers::AssetUrlHelper#asset_path
+```
+
+## Status
+
+* Rust compilation is working
+* Methods are _most likely_ stable
+* Testers and developers are most welcome!
+
## Installation
Ensure Rust is installed:
[Rust Downloads](https://www.rust-lang.org/downloads.html)
@@ -42,15 +80,15 @@
## Usage
Current methods implemented:
-|Rust Implementation|Ruby Implementation|Performance Improvemant|
-|---|---|---|
-| `FasterPath.absolute?` | `Pathname#absolute?` | 545% to 1450% |
-| `FasterPath.chop_basename` | `Pathname#chop_basename` | 6.7% to 54.6% |
-| FasterPath.blank? | | |
+|FasterPath Rust Implementation|Ruby 2.3.1 Implementation|Performance Improvement|
+|---|---|:---:|
+| `FasterPath.absolute?` | `Pathname#absolute?` | 1234.6% |
+| `FasterPath.chop_basename` | `Pathname#chop_basename` | 27.5% |
+| `FasterPath.blank?` | | |
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.
@@ -62,10 +100,10 @@
```
require "faster_path/optional/refinements"
using FasterPath::RefinePathname
```
-And for the sldeghammer of monkey patching you can do
+And for the sledgehammer of monkey patching you can do
```
require "faster_path/optional/monkeypatching"
FasterPath.sledgehammer_everything!
```