This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* boolean * function-bridge * map * string
- Loading branch information
1 parent
0e8ce9c
commit f2a09eb
Showing
5 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use strict"; | ||
|
||
module.exports = function iterateAndMeasure(fn, mod = 1000000) { | ||
let count = 0; | ||
while (true) { | ||
count++; | ||
fn(); | ||
if (count % mod === 0) { | ||
console.log(process.memoryUsage().rss / 1000000); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
var types = require('../').types; | ||
var iterateAndMeasure = require('./_measure'); | ||
|
||
iterateAndMeasure(function() { return types.Boolean(true).getValue(); }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"use strict"; | ||
|
||
var sass = require("../"); | ||
var iterateAndMeasure = require('./_measure'); | ||
|
||
iterateAndMeasure(function() { | ||
sass.renderSync({ | ||
data: '#{headings()} { color: #08c; }', | ||
functions: { | ||
'headings()': function() { | ||
return new sass.types.String('hi'); | ||
} | ||
} | ||
}); | ||
}, 10000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
|
||
var types = require('../').types; | ||
var iterateAndMeasure = require('./_measure'); | ||
|
||
iterateAndMeasure(function() { | ||
var key = new types.String('the-key'); | ||
var value = new types.String('the-value'); | ||
|
||
var map = new types.Map(1); | ||
|
||
map.setKey(0, key); | ||
map.setValue(0, value); | ||
|
||
map.getKey(0); | ||
}, 100000); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
var types = require('../').types; | ||
var iterateAndMeasure = require('./_measure'); | ||
|
||
iterateAndMeasure(function() { return new types.String('hi'); }); |