forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple initial-render benchmark test case
- Loading branch information
1 parent
65b9ceb
commit e849819
Showing
5 changed files
with
15,885 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 |
---|---|---|
|
@@ -11,4 +11,5 @@ docs/vendor/bundle/ | |
examples/ | ||
# Ignore built files. | ||
build/ | ||
scripts/bench/bench-*.js | ||
vendor/react-dom.js |
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,23 @@ | ||
Work-in-progress benchmarks. | ||
|
||
## Running one | ||
One thing you can do with them is benchmark initial render time for a realistic hierarchy: | ||
|
||
``` | ||
$ which jsc | ||
/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc | ||
$ jsc react-0.14.0.min.js bench-pe-es5.js -e 'var START=Date.now(); React.renderToString(React.createElement(Benchmark)); var END=Date.now(); print(END-START);' | ||
45 | ||
``` | ||
|
||
Substitute `js` or `v8` for `jsc` to use SpiderMonkey or V8, respectively, if you've installed them. | ||
|
||
## Creating one | ||
|
||
To create one, copy `extract-component.js` to your clipboard and paste it into the Chrome console on facebook.com, perhaps after changing the root ID if you don't want the tree with ID `.0`. | ||
|
||
Then to convert it to ES5: | ||
|
||
``` | ||
babel --whitelist react,react.displayName --compact false bench-pe.js >bench-pe-es5.js | ||
``` |
Oops, something went wrong.