1.0.1 • Published 8 years ago

keepr v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

Keepr


The simple file caching module for Node.js.
Keepr is handy in those I/O intensive applications where files are read and processed frequently. It caches file content up to a given maximum byte size, while keeping the most frequently used files in memory and purging the least frequently used.

Features


  • Caches file content in memory for quick retrieval.
    • Reduces expensive file system I/O calls.
    • Keeps frequently used content readily available.
    • You can set the maximum cache size.
  • Keeps the newest, most frequently used files first.
    • Uses a LFU/Oldest First composite algorithm.
    • Retrieve cached contents in any supported encoding or get a safe copy of the buffer contents.
  • Safely store file contents in memory
    • Keepr helps prevent heap allocation errors by capping stored file contents to a preset size.
    • If a file is modified or deleted it is uncached automagically.
  • 99% Test Coverage

Install


$ npm install keepr --save

Getting Started


var keepr = require('keepr');

// 1st call: file is read and cached.
keepr.get('./some/file.js', function (err, contents) { ... });

// All subsequent calls will return the cached contents.
keepr.get('./some/file.js', function (err, contents) { ... });

// Or wrap the fs.module...
keepr.wrapFS();

// Now fs will use Keepr's cache!
var fs = require('fs');
fs.readFile('./some/file.js', function (err, contents) { ... });

Keepr#get performs async file reads...
Keepr#getSync can be used to perform synchronous file reads (if you feel it's absolutely necessary).

You can also use the aliases: Keepr#read and Keepr#readSync.

fs.readFileSync is also wrapped when you call keepr.wrapFS.

Keepr exports a singleton...

You can require it from any file and the same instance will be returned.
However, if desired, multiple instances of Keepr can be created using the require('keepr').Keepr class.

Contents


  1. Install
  2. Getting Started
  3. Options
  4. Purging Cache
  5. Wrapping The FS Module
  6. Other Methods
  7. Performance

Options

For most, the default options will suffice, however, you can tweak Keepr with the following options:

var keepr = require('keepr');

// Default settings shown...

keepr.setOptions({
    // The finite maximum size the cache can grow to.
    // If set to < 0, the cache can grow infinitely.
    size: require('v8').getHeapStatistics().total_available_size * 0.75,
    // If true, cache will be invalidated if the file is modified.
    watch: true,
    // Alters the caching algorithm.
    historyFactor: 2,
    // Prints debug messages to the stdout.
    debug: false
});

Keepr#setOptions({Object} options) → {Keepr}

Sets one or more of the following options...

PropertyDefaultDescription
{Number|String} size75% of the available heap spaceSets the maxCacheLimit; the maximum size the cache is allowed to grow to. If maxCacheLimit <= 0, the cache can grow infinitely.
{Boolean} watchtrueIf true, cache will be invalidated when a file is modified (uses fs.watch).Note: If false, cache calls to changed files will return obsolete contents! However, if you're sure the files won't change, this could provide a performance boost.
{String} historyFactor2An number between 1.5 and 8.Changes the portion of the cache that is considered for release when the cache is full (2 = half the cache size, 4 = a quarter, etc.). A higher setting will focus more on cache age, a lower setting will focus more on frequency.
{Boolean} debugfalseIf true, Keepr will print debug information to the stdout.

Keepr#getOptions() → {Object}

Returns the current options as an object.

Size Strings

A size string can be used instead of a byte size when setting the maxCacheLimit
A size string must match the following regular expression: /^ *(\d+(?:\.\d+)?) *(b|kb|mb|gb) *$/i. The following strings are valid "size strings" where xxx is a number:

StringMagnitude
'xxxb'Bytes
'xxxkb'Kilobytes
'xxxmb'Megabytes
'xxxgb'Gigabytes

Examples

var keepr = require('keepr');

keepr.setOptions({ size: '5000b' });
keepr.setOptions({ size: '5000kb' });
keepr.setOptions({ size: '200mb' });
keepr.setOptions({ size: '1.5gb' });

Purging Cache

To manually purge the cache call Keepr#purge. However, in most cases, manually purging the cache is unnecessary and should be avoided in favor of performance.

Keepr#purge({...String=} filename) → {Keepr}

// Frees all cache for garbage collection...
keepr.purge();

// You can purge a specific file by passing in a filename.
keepr.purge('./my/file.js');

// ...or multiple files...
keepr.purge('./my/file.js', './my/file2.js');

Wrapping The FS Module

Keepr provides a method to wrap the native Node FS module. This ensures that all calls made to fs.readFile and fs.readFileSync will be cached. Thus, other modules that read from the file system will utilize the Keepr caching system as well.

Keepr#wrapFS() → {Keepr}

var keepr = require('keepr');
    fs    = require('fs');

// Wrap fs.readFile and fs.readFileSync
keepr.wrapFS();

// First call, contents read and cached.
fs.readFile('./my/file.js', function (err, contents) { ... });

// Next call, cached contents returned.
fs.readFile('./my/file.js', function (err, contents) { ... });

// If for any reason you need to un-wrap the file system methods...
keepr.unwrapFS();

If you need to use the vanilla FS methods for a "don't cache" situation after wrapping the fs module, you can use Keepr#noCache or Keepr#noCacheSync

Note, Keepr#wrapFS and Keepr#unwrapFS are available only to the singleton instance returned when required. Newly created instances will not have these methods.

Other Methods

Keepr#noCache()

Always returns the vanilla version of fs.readFile.

Keepr#noCacheSync()

Always returns the vanilla version of fs.readFileSync.

Keepr#dump() → {Object}

Exports a skeleton copy of the the cache content as an object (without the data)

var data = keepr.dump();
// Returns something like:
{
    '/my/file.json:buffer': {
        size: 714,
        source: '/my/file.json',
        called: 0,
        encoding: 'buffer',
        hash: '/my/file.json:buffer'
    },
    '/my/other/file.xml:utf-8': {
        size: 10456,
        source: '/my/other/file.xml',
        called: 1,
        encoding: 'utf-8',
        hash: '/my/other/file:utf-8'
    }
    ...
}

Keepr#isCached({String} filename) → {Boolean}

Returns true if the provided filename exists in the cache, false otherwise.

var isCached = keepr.isCached('./my/file.js'); // -> true or false

Keepr#utiltized() → {Number}

The percentage of the cache that is currently utilized.

var utilized = keepr.utiltized(); // 0 >= x <= 1

Keepr#currentSize() → {Number}

The sum of all cached data in bytes.

var cacheSize = keepr.currentSize(); // 0 >= x <= keepr.getOptions().size;

Keepr#sizeOf({String|Buffer} item) → {Number}

Returns the size of the given argument in bytes.
If the argument isn't a Buffer or string, it will be cast to a string. This is essentially an alias for: Buffer.byteLength.

var sizeOfString = keepr.sizeOf('a string'); // -> 8

Performance

Basically, the test was to read files of various sizes 1, 2, 5, and 20 times in succession, both asynchronously and synchronously.
All tests were performed on a MacBook Pro, 2.8 GHz Intel Core i7, Apple SSD.

The result of each file size is listed below.

Summary

On average, the first file read takes about 30% longer using Keepr compared to the vanilla fs module. However, subsequent reads were much faster using Keepr ranging from 4 to 17,000+ times faster over vanilla fs.

The larger the files, the better Keepr performs.
Async, multiple reads of small files (less than 100kb) are about 5x times faster using Keepr. Larger files can be up to 99.9% faster.

Keepr works better asynchronously.
Keepr outperformed vanilla fs for all file sizes when reading async. For synchronous file reads, fs was faster for files smaller than 50kb. With files larger than 50kb sync, Keepr outperformed... and especially for files larger than 1mb.

The performance test files can be found in the performance directory of this repo.

The Bottom Line

So long as you have heap to spare and files to read, Keepr's a good choice.

Async

The files were read asynchronously using Keepr's fs.readFile wrapper.

0.1KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer6.73 MS8.69 MS-22.63%0.775MB6MB
21Hex1.06 MS3.44 MS-69.11%0.315MB6MB
31Base641.14 MS3.22 MS-64.63%0.355MB6MB
41UTF-81.61 MS3.35 MS-52.06%0.485MB6MB
52Buffer2.36 MS0.54 MS76.95%4.345MB6MB
62UTF-81.83 MS0.24 MS86.84%7.65MB6MB
72Hex1.73 MS0.24 MS86.29%7.35MB6MB
82Base641.64 MS0.66 MS60.05%2.55MB6MB
95Buffer3.8 MS0.95 MS75.13%4.025MB6MB
105UTF-83.42 MS0.89 MS73.96%3.845MB6MB
115Hex3.17 MS0.43 MS86.44%7.385MB6MB
125Base642.5 MS0.71 MS71.77%3.545MB6MB
1320Buffer6.89 MS2.42 MS64.90%2.856MB6MB
1420UTF-86.03 MS3.7 MS38.62%1.636MB5MB
1520Hex5.37 MS1.02 MS80.98%5.266MB6MB
1620Base644.52 MS0.65 MS85.61%6.956MB6MB

1.0KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer7.11 MS8.76 MS-18.84%0.815MB6MB
21UTF-82.24 MS3.45 MS-35.04%0.655MB6MB
31Hex2.1 MS3.24 MS-35.07%0.655MB6MB
41Base642.04 MS3.39 MS-39.73%0.65MB6MB
52Buffer2.86 MS0.38 MS86.65%7.495MB6MB
62UTF-83.2 MS0.14 MS95.73%23.445MB6MB
72Hex3.13 MS0.14 MS95.60%22.715MB6MB
82Base643.05 MS0.4 MS86.77%7.565MB6MB
95Buffer2.48 MS0.67 MS72.90%3.695MB6MB
105UTF-82.23 MS0.67 MS69.94%3.335MB6MB
115Hex2.09 MS0.54 MS73.98%3.845MB6MB
125Base641.67 MS0.82 MS51.01%2.045MB6MB
1320Buffer5.1 MS1.58 MS69.00%3.236MB6MB
1420UTF-84.37 MS1.21 MS72.32%3.616MB5MB
1520Hex4.06 MS0.59 MS85.58%6.946MB6MB
1620Base643.76 MS0.58 MS84.56%6.486MB6MB

5.0KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer7.48 MS10.26 MS-27.04%0.735MB6MB
21UTF-82.02 MS3.73 MS-45.77%0.545MB6MB
31Hex1.67 MS3.5 MS-52.47%0.485MB6MB
41Base641.64 MS3.65 MS-54.94%0.455MB6MB
52UTF-81.39 MS0.53 MS61.91%2.635MB6MB
62Buffer2.4 MS0.23 MS90.34%10.355MB6MB
72Hex2 MS0.22 MS89.11%9.185MB6MB
82Base641.96 MS0.61 MS68.69%3.195MB6MB
95Buffer4.4 MS0.96 MS78.12%4.575MB6MB
105UTF-84 MS0.9 MS77.46%4.445MB6MB
115Hex3.8 MS0.89 MS76.46%4.255MB6MB
125Base643.05 MS1.01 MS66.90%3.026MB6MB
1320Buffer5.05 MS4.09 MS19.11%1.246MB5MB
1420UTF-84.44 MS1.23 MS72.29%3.616MB5MB
1520Hex4.12 MS0.64 MS84.54%6.476MB6MB
1620Base644.91 MS0.63 MS87.20%7.815MB6MB

50.0KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer6.87 MS11.79 MS-41.76%0.585MB6MB
21UTF-81.58 MS4.03 MS-60.72%0.395MB6MB
31Hex1.55 MS3.92 MS-60.48%0.45MB6MB
41Base641.61 MS4.14 MS-61.13%0.395MB6MB
52Buffer1.54 MS0.53 MS65.55%2.95MB6MB
62UTF-81.28 MS0.23 MS82.38%5.686MB6MB
72Hex2.29 MS0.44 MS80.58%5.156MB6MB
82Base642.34 MS0.65 MS72.30%3.616MB6MB
95Buffer4.45 MS0.83 MS81.30%5.356MB6MB
105UTF-85.19 MS0.63 MS87.88%8.255MB6MB
115Hex5.63 MS0.26 MS95.46%22.016MB6MB
125Base645.37 MS1.87 MS65.14%2.876MB5MB
1320Buffer6.29 MS2.18 MS65.26%2.886MB6MB
1420UTF-86.39 MS1.83 MS71.41%3.56MB6MB
1520Hex7.14 MS0.92 MS87.05%7.725MB6MB
1620Base647.77 MS0.83 MS89.37%9.417MB6MB

100.0KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer8.36 MS9.02 MS-7.31%0.935MB6MB
21UTF-82.07 MS4.09 MS-49.47%0.515MB6MB
31Base642 MS4.21 MS-52.56%0.475MB6MB
41Hex2.41 MS4.6 MS-47.65%0.526MB6MB
52Buffer2.7 MS0.38 MS86.04%7.166MB6MB
62Hex3.38 MS0.14 MS95.91%24.425MB6MB
72UTF-83.59 MS0.13 MS96.38%27.615MB6MB
82Base643.69 MS0.41 MS88.97%9.066MB6MB
95Buffer2.47 MS0.88 MS64.19%2.796MB6MB
105UTF-82.7 MS0.83 MS69.40%3.276MB6MB
115Hex3.49 MS0.71 MS79.58%4.95MB6MB
125Base643.7 MS1.05 MS71.52%3.516MB6MB
1320Buffer7.07 MS1.67 MS76.34%4.236MB6MB
1420UTF-87.23 MS1.36 MS81.20%5.326MB6MB
1520Hex9.6 MS0.74 MS92.27%12.937MB7MB
1620Base6411.15 MS0.7 MS93.73%15.955MB7MB

500.4KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer7.14 MS8.83 MS-19.15%0.815MB6MB
21Hex4.03 MS4.26 MS-5.48%0.957MB6MB
31UTF-84.9 MS6.47 MS-24.25%0.765MB7MB
41Base645.19 MS8.39 MS-38.21%0.627MB8MB
52Buffer4.34 MS0.38 MS91.30%11.57MB8MB
62UTF-84.07 MS0.12 MS96.93%32.626MB8MB
72Hex5.71 MS0.12 MS97.96%49.16MB8MB
82Base646.92 MS0.4 MS94.26%17.416MB8MB
95Buffer3.38 MS0.89 MS73.73%3.816MB8MB
105UTF-83.86 MS0.84 MS78.21%4.596MB8MB
115Hex10.4 MS0.86 MS91.69%12.035MB8MB
125Base6412.6 MS1.05 MS91.64%11.956MB8MB
1320Buffer12.01 MS2.37 MS80.25%5.066MB8MB
1420UTF-817.39 MS1.92 MS88.98%9.086MB8MB
1520Hex28.38 MS0.78 MS97.27%36.575MB9MB
1620Base6438.67 MS0.78 MS97.99%49.675MB9MB

1.0MB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer7.6 MS9.76 MS-22.13%0.785MB6MB
21Hex4.24 MS6.41 MS-33.89%0.665MB7MB
31Base645.8 MS8.63 MS-32.79%0.675MB7MB
41UTF-87.6 MS10.57 MS-28.11%0.727MB7MB
52Buffer2.93 MS0.97 MS66.95%3.035MB6MB
62UTF-85.59 MS0.12 MS97.82%45.917MB6MB
72Hex8.97 MS0.12 MS98.70%77.087MB7MB
82Base6410.14 MS0.41 MS95.96%24.747MB7MB
95Buffer3.92 MS1.06 MS73.02%3.715MB7MB
105UTF-84.75 MS0.81 MS82.83%5.837MB7MB
115Hex14.15 MS0.62 MS95.61%22.797MB7MB
125Base6422.24 MS0.96 MS95.67%23.087MB7MB
1320Buffer16.34 MS1.44 MS91.18%11.345MB7MB
1420UTF-820.84 MS1.35 MS93.53%15.465MB7MB
1520Hex55.37 MS0.77 MS98.60%71.455MB7MB
1620Base6482.27 MS1.53 MS98.14%53.85MB7MB

5.0MB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer10.69 MS15.21 MS-29.71%0.75MB6MB
21UTF-88.25 MS13.09 MS-37.01%0.6310MB11MB
31Base6415.95 MS27 MS-40.93%0.5910MB11MB
41Hex27.07 MS37.05 MS-26.94%0.7310MB11MB
52UTF-813.36 MS0.55 MS95.88%24.2720MB11MB
62Buffer13.81 MS0.22 MS98.43%63.4920MB11MB
72Hex31.47 MS0.22 MS99.30%143.0120MB11MB
82Base6446.23 MS0.67 MS98.56%69.320MB11MB
95Buffer18.84 MS1.09 MS94.20%17.2520MB11MB
105UTF-840.08 MS0.89 MS97.78%45.0624MB11MB
115Hex81.21 MS0.67 MS99.18%121.9324MB11MB
125Base64109.98 MS0.94 MS99.14%116.7224MB11MB
1320Buffer78.16 MS2.5 MS96.81%31.315MB12MB
1420UTF-8155.22 MS2.79 MS98.20%55.5444MB11MB
1520Hex345.08 MS0.65 MS99.81%532.0544MB11MB
1620Base64518.09 MS0.64 MS99.88%813.614MB11MB

50.0MB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer36.34 MS61.05 MS-40.48%0.65MB6MB
21UTF-859.42 MS95.03 MS-37.48%0.6355MB56MB
31Hex159.32 MS216.76 MS-26.50%0.7455MB56MB
41Base64225.53 MS304.31 MS-25.89%0.7455MB56MB
52Buffer66.71 MS0.56 MS99.15%118.094MB56MB
62UTF-8124.67 MS0.24 MS99.81%525.9105MB56MB
72Hex316.12 MS0.66 MS99.79%481.58105MB56MB
82Base64496.47 MS0.67 MS99.86%737.414MB56MB
95Buffer157.23 MS1.49 MS99.05%105.64MB56MB
105UTF-8332.3 MS1.75 MS99.47%190.36104MB56MB
115Hex989.95 MS1.1 MS99.89%897.384MB56MB
125Base641,256.03 MS1.8 MS99.86%698.354MB56MB
1320Buffer895.78 MS7.27 MS99.19%123.284MB55MB
1420UTF-81,819.7 MS1.25 MS99.93%1,458.24154MB55MB
1520Hex3,802.18 MS0.62 MS99.98%6,091.134MB55MB
1620Base645,165.94 MS0.72 MS99.99%7,127.954MB56MB

100.0MB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer74.05 MS115.99 MS-36.16%0.644MB6MB
21UTF-8132.14 MS202.13 MS-34.62%0.65104MB106MB
31Base64286.77 MS474.95 MS-39.62%0.6105MB106MB
41Hex479.06 MS665.56 MS-28.02%0.72105MB106MB
52Buffer141.6 MS0.43 MS99.70%328.234MB106MB
62UTF-8260.97 MS0.16 MS99.94%1,673.47205MB106MB
72Base64784.35 MS0.14 MS99.98%5,566.854MB106MB
82Hex1,040.47 MS0.41 MS99.96%2,553.884MB106MB
95Buffer318.48 MS1.34 MS99.58%238.054MB106MB
105UTF-8689.47 MS1.66 MS99.76%415.67204MB106MB
115Hex1,760.91 MS0.52 MS99.97%3,380.64MB106MB
125Base642,487.3 MS2.82 MS99.89%881.24MB105MB
1320Buffer3,908.69 MS2.48 MS99.94%1,576.164MB105MB
1420UTF-86,582.4 MS1.73 MS99.97%3,801.71304MB105MB
1520Hex12,025.29 MS1.14 MS99.99%10,540.34MB106MB
1620Base6415,092.66 MS0.87 MS99.99%17,271.634MB106MB

Sync

The files were read synchronously using Keepr's fs.readFileSync wrapper.
You probably shouldn't use Keepr if you're dealing with a lot of files less than 50kb and reading them synchronously.

0.1KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer0.16 MS1.38 MS-88.16%0.125MB5MB
21UTF-80.08 MS0.27 MS-69.76%0.35MB5MB
31Hex0.08 MS0.12 MS-32.09%0.685MB6MB
41Base640.06 MS1.48 MS-95.84%0.045MB6MB
52Buffer0.09 MS0.17 MS-45.99%0.545MB6MB
62UTF-80.1 MS0.12 MS-12.69%0.875MB6MB
72Hex0.1 MS0.12 MS-16.76%0.835MB6MB
82Base640.45 MS0.28 MS36.67%1.585MB6MB
95Buffer0.13 MS0.34 MS-61.80%0.385MB6MB
105UTF-80.14 MS0.41 MS-67.26%0.335MB6MB
115Hex0.87 MS0.33 MS61.88%2.625MB6MB
125Base640.14 MS0.28 MS-50.12%0.55MB6MB
1320Buffer0.42 MS1.28 MS-67.18%0.335MB6MB
1420UTF-80.57 MS1.88 MS-69.62%0.35MB5MB
1520Hex0.45 MS0.48 MS-4.68%0.955MB5MB
1620Base640.53 MS0.51 MS4.33%1.055MB6MB

1.0KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer0.16 MS1.36 MS-88.33%0.125MB5MB
21UTF-80.08 MS0.25 MS-67.69%0.325MB5MB
31Hex0.08 MS0.13 MS-35.55%0.645MB6MB
41Base640.09 MS0.77 MS-88.86%0.115MB6MB
52Buffer0.11 MS0.17 MS-38.74%0.615MB6MB
62UTF-80.1 MS0.27 MS-61.15%0.395MB6MB
72Hex0.11 MS0.27 MS-59.95%0.45MB6MB
82Base640.45 MS0.32 MS29.98%1.435MB6MB
95Buffer0.15 MS0.42 MS-64.53%0.355MB6MB
105UTF-80.15 MS0.31 MS-53.18%0.475MB6MB
115Hex0.99 MS0.24 MS75.42%4.075MB6MB
125Base640.32 MS0.35 MS-8.38%0.925MB6MB
1320Buffer0.52 MS1.32 MS-60.58%0.395MB6MB
1420UTF-80.96 MS1.93 MS-50.17%0.55MB5MB
1520Hex0.47 MS0.48 MS-1.80%0.985MB5MB
1620Base640.55 MS1.34 MS-58.58%0.415MB6MB

5.0KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer0.16 MS1.36 MS-88.20%0.125MB5MB
21UTF-80.07 MS0.28 MS-74.08%0.265MB5MB
31Hex0.09 MS0.14 MS-33.01%0.675MB6MB
41Base640.11 MS0.76 MS-85.80%0.145MB6MB
52Buffer0.1 MS0.17 MS-44.49%0.565MB6MB
62UTF-80.11 MS0.12 MS-4.28%0.965MB6MB
72Hex0.14 MS0.12 MS14.03%1.165MB6MB
82Base640.47 MS0.29 MS39.00%1.645MB6MB
95Buffer0.14 MS0.5 MS-72.59%0.275MB6MB
105UTF-80.15 MS0.53 MS-71.07%0.295MB6MB
115Hex0.8 MS0.46 MS42.51%1.745MB6MB
125Base640.24 MS0.35 MS-32.35%0.685MB6MB
1320Buffer0.61 MS1.27 MS-52.31%0.485MB6MB
1420UTF-80.9 MS1.72 MS-47.72%0.526MB5MB
1520Hex0.73 MS0.47 MS36.40%1.576MB5MB
1620Base642 MS0.5 MS75.25%4.045MB6MB

50.0KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer0.17 MS1.41 MS-87.96%0.125MB5MB
21UTF-80.11 MS0.3 MS-63.47%0.375MB6MB
31Hex0.29 MS0.3 MS-2.00%0.985MB6MB
41Base640.21 MS0.81 MS-73.78%0.265MB6MB
52Buffer0.12 MS0.19 MS-35.38%0.655MB6MB
62UTF-80.2 MS0.1 MS51.62%2.075MB6MB
72Hex0.38 MS0.12 MS69.28%3.266MB6MB
82Base640.67 MS0.29 MS57.60%2.366MB6MB
95Buffer0.24 MS0.35 MS-31.83%0.686MB6MB
105UTF-81.97 MS0.42 MS78.93%4.755MB6MB
115Hex0.78 MS0.31 MS59.69%2.485MB6MB
125Base640.62 MS0.28 MS55.01%2.226MB6MB
1320Buffer0.79 MS2.24 MS-64.71%0.356MB5MB
1420UTF-81.61 MS0.93 MS42.33%1.735MB6MB
1520Hex1.83 MS0.57 MS68.69%3.195MB6MB
1620Base641.54 MS0.9 MS41.65%1.717MB6MB

100.0KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer0.17 MS1.46 MS-88.19%0.125MB5MB
21UTF-80.15 MS0.48 MS-69.22%0.315MB6MB
31Hex0.34 MS0.37 MS-7.84%0.925MB6MB
41Base640.34 MS0.91 MS-63.05%0.375MB6MB
52Buffer0.28 MS0.14 MS49.01%1.965MB6MB
62UTF-80.53 MS0.08 MS85.26%6.796MB6MB
72Hex2.4 MS0.07 MS97.01%33.495MB6MB
82Base640.99 MS0.24 MS75.73%4.125MB6MB
95Buffer0.86 MS0.38 MS55.93%2.275MB6MB
105UTF-80.63 MS1.41 MS-55.56%0.446MB6MB
115Hex1.61 MS0.45 MS71.88%3.566MB6MB
125Base640.99 MS0.28 MS71.66%3.536MB6MB
1320Buffer1.29 MS1.16 MS10.44%1.126MB6MB
1420UTF-81.47 MS1.01 MS31.54%1.467MB6MB
1520Hex4.34 MS0.59 MS86.37%7.337MB7MB
1620Base643.58 MS0.57 MS84.19%6.336MB7MB

500.4KB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer0.25 MS1.53 MS-83.63%0.165MB5MB
21UTF-80.39 MS0.74 MS-47.79%0.526MB6MB
31Hex3.6 MS3.33 MS7.35%1.087MB7MB
41Base641.2 MS2.12 MS-43.50%0.566MB8MB
52Buffer0.24 MS0.15 MS38.32%1.626MB8MB
62UTF-80.56 MS0.12 MS79.01%4.766MB8MB
72Hex1.92 MS0.11 MS94.52%18.268MB8MB
82Base642.62 MS0.28 MS89.49%9.516MB8MB
95Buffer0.39 MS0.45 MS-12.29%0.886MB8MB
105UTF-82.15 MS0.43 MS79.84%4.966MB8MB
115Hex5.71 MS0.3 MS94.78%19.178MB8MB
125Base642.94 MS0.28 MS90.52%10.556MB8MB
1320Buffer2.85 MS1.22 MS57.19%2.346MB8MB
1420UTF-88.42 MS1 MS88.13%8.436MB8MB
1520Hex17.92 MS0.59 MS96.69%30.2313MB9MB
1620Base6413.93 MS0.6 MS95.69%23.1911MB9MB

1.0MB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer0.72 MS2.44 MS-70.35%0.35MB5MB
21UTF-81.59 MS2.05 MS-22.20%0.787MB7MB
31Hex2.43 MS3.13 MS-22.55%0.777MB6MB
41Base642.37 MS2.21 MS7.01%1.087MB6MB
52Buffer1.19 MS0.17 MS86.04%7.167MB6MB
62UTF-81.69 MS0.12 MS93.19%14.687MB6MB
72Hex3.4 MS0.11 MS96.83%31.597MB6MB
82Base643.43 MS0.27 MS92.03%12.547MB6MB
95Buffer3.07 MS0.38 MS87.51%85MB6MB
105UTF-82.25 MS0.41 MS81.55%5.428MB7MB
115Hex9.68 MS0.37 MS96.13%25.838MB7MB
125Base646.6 MS0.25 MS96.15%25.958MB7MB
1320Buffer8 MS1.25 MS84.43%6.428MB7MB
1420UTF-813.53 MS1.11 MS91.83%12.2310MB7MB
1520Hex43.99 MS0.61 MS98.61%71.7310MB7MB
1620Base6436.56 MS1.18 MS96.77%30.9210MB6MB

5.0MB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer2.93 MS6.61 MS-55.73%0.445MB5MB
21UTF-86.92 MS4.44 MS35.86%1.5610MB10MB
31Hex13.71 MS13.92 MS-1.49%0.9910MB11MB
41Base6410.69 MS10.68 MS0.10%110MB11MB
52Buffer4.67 MS0.15 MS96.74%30.6910MB11MB
62UTF-811.9 MS0.12 MS98.98%98.4620MB11MB
72Hex24.34 MS0.11 MS99.54%218.3420MB11MB
82Base6419.34 MS0.31 MS98.41%62.8120MB11MB
95Buffer10.72 MS0.4 MS96.26%26.7620MB11MB
105UTF-825.01 MS0.53 MS97.89%47.3545MB11MB
115Hex60.79 MS0.36 MS99.41%168.9245MB11MB
125Base6456.48 MS0.32 MS99.43%174.174MB11MB
1320Buffer45.7 MS1.32 MS97.11%34.644MB11MB
1420UTF-8128.92 MS1.07 MS99.17%120.3654MB10MB
1520Hex222.01 MS0.5 MS99.77%441.854MB11MB
1620Base64228.72 MS1.16 MS99.49%197.294MB11MB

50.0MB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer24.99 MS53.3 MS-53.12%0.475MB5MB
21UTF-859 MS39.28 MS33.42%1.555MB56MB
31Hex123.21 MS122.9 MS0.25%155MB56MB
41Base6494.75 MS95.44 MS-0.72%0.9955MB56MB
52Buffer51.92 MS0.2 MS99.62%262.7555MB56MB
62UTF-8119.61 MS0.1 MS99.92%1,179.8104MB56MB
72Hex232.46 MS0.2 MS99.91%1,149.72104MB56MB
82Base64232.81 MS0.31 MS99.87%762.784MB56MB
95Buffer126.82 MS0.83 MS99.35%153.294MB56MB
105UTF-8227.61 MS1.06 MS99.53%214.55204MB56MB
115Hex513.22 MS0.81 MS99.84%633.054MB56MB
125Base64423.3 MS1.03 MS99.76%412.534MB56MB
1320Buffer407.35 MS2.37 MS99.42%172.184MB56MB
1420UTF-8922.59 MS2.41 MS99.74%382.66404MB55MB
1520Hex1,997.72 MS0.5 MS99.98%4,0174MB55MB
1620Base641,619.55 MS1.04 MS99.94%1,564.434MB56MB

100.0MB File

5/16/2016 • Darwin • 17.18GB Memory • 8 CPUS

PassReadsEncodingFS TimeKeepr Time% FasterX FasterFS HeapKeepr Heap
11Buffer56.12 MS124.24 MS-54.82%0.455MB5MB
21UTF-8125.66 MS110.62 MS11.97%1.14105MB105MB
31Hex249.48 MS298.64 MS-16.46%0.84105MB106MB
41Base64208 MS214.25 MS-2.92%0.97105MB106MB
52Buffer112.44 MS0.18 MS99.84%631.46105MB106MB
62UTF-8278.67 MS0.36 MS99.87%777.87204MB106MB
72Hex529.87 MS0.09 MS99.98%6,164.46204MB106MB
82Base64484.26 MS0.74 MS99.85%650.124MB106MB
95Buffer221.47 MS0.44 MS99.80%497.824MB106MB
105UTF-8484.5 MS1.26 MS99.74%384.7504MB106MB
115Hex1,345.82 MS1.38 MS99.90%974.734MB106MB
125Base64835.84 MS0.8 MS99.90%1,043.374MB106MB
1320Buffer866.66 MS4.63 MS99.47%187.114MB105MB
1420UTF-82,536.83 MS0.99 MS99.96%2,562.01504MB105MB
1520Hex5,339.05 MS0.54 MS99.99%9,900.214MB105MB
1620Base643,578.12 MS0.47 MS99.99%7,620.514MB106MB