Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Performance when using javascript custom functions #1198

@eoneill

Description

@eoneill

Javascript custom functions are awesome, and my current work wouldn't be possible without them, but we're noticing some performance impact when passing along large maps.

I threw together a minimal test case to demonstrate this: eoneill/node-sass-perf-test

The test has two functions (perftest-native and perftest-js) that simply return the value passed to it:

@function perftest-native($value) {
  @return $value;
}
"perftest-js($value)": function($value) {
  return $value;
}

Each method is passed a map with 5000 entries (a bit absurd, granted).

The finding is that the javascript method is exponentially slower than the native (Sass) method:

[native] elapsed time: 2ms
[js] elapsed time: 32ms

Lemme know if I can help provide any more information.

Thanks again for all the awesome work you guys do!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions