From: Jakub Pawlowicz Date: Thu, 5 Jan 2017 13:46:02 +0000 (+0100) Subject: Removes `benchmark` API option. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=783213947b559973928e1aa2c1d6c77149d828bc;p=clean-css.git Removes `benchmark` API option. Why: * total time is reported under `stats`; * it was seriously impaired since optimizing got encapsulated and not invoked directly from lib/clean.js. --- diff --git a/History.md b/History.md index 2ef97ec8..767a9db0 100644 --- a/History.md +++ b/History.md @@ -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. diff --git a/README.md b/README.md index a65e3908..a93de9d9 100644 --- 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 diff --git a/lib/clean.js b/lib/clean.js index 584e2ad6..29209923 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -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 || {}, diff --git a/test/bench.js b/test/bench.js index c17dff12..a7f04f38 100644 --- a/test/bench.js +++ b/test/bench.js @@ -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;