Removes `benchmark` API option.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Thu, 5 Jan 2017 13:46:02 +0000 (14:46 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Thu, 5 Jan 2017 13:46:02 +0000 (14:46 +0100)
Why:

* total time is reported under `stats`;
* it was seriously impaired since optimizing got encapsulated
  and not invoked directly from lib/clean.js.

History.md
README.md
lib/clean.js
test/bench.js

index 2ef97ec..767a9db 100644 (file)
@@ -4,6 +4,7 @@
 * Adds more detailed error & warning messages on top of the new tokenizer.
 * Fixes a bug ignoring incorrect properties in complex restructuring.
 * Requires Node.js 4.0+ to run.
+* Removes `benchmark` API option as total time is always reported under `stats` property.
 * Removes `debug` API switch as stats are always gathered and available under `stats` property.
 * Replaces the old tokenizer with a new one which doesn't use any escaping.
 * Replaces the old `@import` inlining with one on top of the new tokenizer.
index a65e390..a93de9d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -124,7 +124,6 @@ CleanCSS constructor accepts a hash as a parameter, i.e.,
 * `advanced` - set to false to disable advanced optimizations - selector & property merging, reduction, etc.
 * `aggressiveMerging` - set to false to disable aggressive merging of properties.
 * `beautify` - formats output CSS by using indentation and one rule or property per line.
-* `benchmark` - turns on benchmarking mode measuring time spent on cleaning up (run `npm run bench` to see example)
 * `compatibility` - enables compatibility mode, see [below for more examples](#how-to-set-a-compatibility-mode)
 * `inline` - whether to inline `@import` rules, can be `['all']`, `['local']` (default), `['remote']`, or a blacklisted domain/path e.g. `['!fonts.googleapis.com']`
 * `inlineRequest` - an object with [HTTP(S) request options](https://nodejs.org/api/http.html#http_http_request_options_callback) for inlining remote `@import` rules
index 584e2ad..2920992 100644 (file)
@@ -28,7 +28,6 @@ var CleanCSS = module.exports = function CleanCSS(options) {
     advanced: undefined === options.advanced ? true : !!options.advanced,
     aggressiveMerging: undefined === options.aggressiveMerging ? true : !!options.aggressiveMerging,
     beautify: undefined === options.beautify ? false : !!options.beautify,
-    benchmark: options.benchmark,
     compatibility: compatibility(options.compatibility),
     inline: inlineOptionsFrom(options.inline),
     inlineRequest: options.inlineRequest || {},
index c17dff1..a7f04f3 100644 (file)
@@ -5,7 +5,7 @@ var total = 0;
 
 for (var i = 1; i <= 10; i++) {
   var start = process.hrtime();
-  new CleanCSS({ benchmark: i == 10 }).minify(input);
+  new CleanCSS().minify(input);
 
   var itTook = process.hrtime(start);
   total += 1000 * itTook[0] + itTook[1] / 1000000;