-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add std/esm benchmark. #33
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
esm: "js" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
"license": "BSD-3-Clause", | ||
"dependencies": { | ||
"@babel/standalone": "7.0.0-beta.32", | ||
"@std/esm": "^0.21.1", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use exact dependencies. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Not outside Node no. It's Node for sure. Is there a more appropriate suite? The suite description states
Lodash is on more than 2 million websites and impacts over 150,000 npm packages (many of those used by web devs). Since this will be used to load it and others, in the Node context, it seems like a good fit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, good point. I do think we should have a As for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have a good There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have a pretty robust one. It allows swapping out different versions of Lodash/Underscore. It's a long running benchmark though designed to ensure the things Lodash is good at stay good and the things it's bad at stay reasonable.
That's cool too though so testing the Node flavors of Babel, Webpack, etc.? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm very interested in the
I don't think it makes sense to have webpack there. This is definitely something that should be owned and operated by the benchmarking WG. Maybe you can join the call on Monday to discuss the idea? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It'd need some tweaking it's a pretty massive suite.
Sure thing! You can DM details if you'd like. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It also seems to mess with the global state of benchmark.js, which needs to be fixed.
Added note to nodejs/benchmarking#198 for monday's meeting. |
||
"acorn": "5.2.1", | ||
"babylon": "7.0.0-beta.32", | ||
"benchmark": "^2.1.4", | ||
|
@@ -45,6 +46,7 @@ | |
"esprima": "4.0.0", | ||
"jshint": "2.9.5", | ||
"lebab": "2.7.7", | ||
"lodash-es": "^4.17.5", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. Do we even need the explicit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would committing the entire package to the vendor folder be a better place? |
||
"prepack": "0.2.11", | ||
"prettier": "1.8.2", | ||
"source-map": "0.6.1", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2017 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
var esmRequire = (function() { | ||
try { | ||
return __non_webpack_require__("@std/esm")(__non_webpack_module__); | ||
} catch (e) {} | ||
|
||
try { | ||
return module.require("@std/esm")(module); | ||
} catch (e) {} | ||
})(); | ||
|
||
module.exports = { | ||
name: "@std/esm" | ||
}; | ||
|
||
if (typeof esmRequire === "function") { | ||
module.exports.fn = function() { | ||
for (var key in esmRequire.cache) { | ||
delete esmRequire.cache[key]; | ||
} | ||
|
||
return esmRequire("lodash-es"); | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2017 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
const esmBenchmark = require("./std-esm-benchmark"); | ||
|
||
it("std-esm-benchmark runs to completion", () => void esmBenchmark.fn()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not bundled with the webpack build? Can we avoid external configuration files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I can remove it and specify options via its API.