mirror of
https://github.com/sass/sass.git
synced 2024-09-21 10:37:22 +00:00
Clarifying performance expectations about sass and sass-embedded (#3716)
This commit is contained in:
parent
4fc5a9511a
commit
0b8a9b84b6
23
js-api-doc/compile.d.ts
vendored
23
js-api-doc/compile.d.ts
vendored
@ -44,6 +44,11 @@ export interface CompileResult {
|
||||
*
|
||||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package,
|
||||
* **{@link compileAsync} is almost always faster than {@link compile}**, due to
|
||||
* the overhead of emulating synchronous messaging with worker threads and
|
||||
* concurrent compilations being blocked on main thread.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
@ -66,9 +71,9 @@ export function compile(path: string, options?: Options<'sync'>): CompileResult;
|
||||
* This only allows synchronous or asynchronous {@link Importer}s and
|
||||
* {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using Dart Sass, **{@link compile} is almost twice as fast
|
||||
* as {@link compileAsync}**, due to the overhead of making the entire
|
||||
* evaluation process asynchronous.
|
||||
* **Heads up!** When using the `sass` npm package, **{@link compile} is almost
|
||||
* twice as fast as {@link compileAsync}**, due to the overhead of making the
|
||||
* entire evaluation process asynchronous.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
@ -94,6 +99,12 @@ export function compileAsync(
|
||||
*
|
||||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package,
|
||||
* **{@link compileStringAsync} is almost always faster than
|
||||
* {@link compileString}**, due to the overhead of emulating synchronous
|
||||
* messaging with worker threads and concurrent compilations being blocked on
|
||||
* main thread.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
@ -125,9 +136,9 @@ export function compileString(
|
||||
* This only allows synchronous or asynchronous {@link Importer}s and {@link
|
||||
* CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using Dart Sass, **{@link compile} is almost twice as fast
|
||||
* as {@link compileAsync}**, due to the overhead of making the entire
|
||||
* evaluation process asynchronous.
|
||||
* **Heads up!** When using the `sass` npm package, **{@link compileString} is
|
||||
* almost twice as fast as {@link compileStringAsync}**, due to the overhead
|
||||
* of making the entire evaluation process asynchronous.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
|
11
js-api-doc/legacy/render.d.ts
vendored
11
js-api-doc/legacy/render.d.ts
vendored
@ -96,6 +96,11 @@ export interface LegacyResult {
|
||||
* This function synchronously compiles a Sass file to CSS. If it succeeds, it
|
||||
* returns the result, and if it fails it throws an error.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package, **{@link render}
|
||||
* is almost always faster than {@link renderSync}**, due to the overhead of
|
||||
* emulating synchronous messaging with worker threads and concurrent
|
||||
* compilations being blocked on main thread.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
@ -116,9 +121,9 @@ export function renderSync(options: LegacyOptions<'sync'>): LegacyResult;
|
||||
* `callback` with a {@link LegacyResult} if compilation succeeds or {@link
|
||||
* LegacyException} if it fails.
|
||||
*
|
||||
* **Heads up!** When using Dart Sass, **{@link renderSync} is almost twice as
|
||||
* fast as {@link render}** by default, due to the overhead of making the entire
|
||||
* evaluation process asynchronous.
|
||||
* **Heads up!** When using the `sass` npm package, **{@link renderSync} is
|
||||
* almost twice as fast as {@link render}** by default, due to the overhead of
|
||||
* making the entire evaluation process asynchronous.
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass'); // or require('node-sass');
|
||||
|
Loading…
Reference in New Issue
Block a user