Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
memosy
(version: 0)
Comparing performance of:
memo vs no
Created:
4 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div id="root"></div> <script src="https://unpkg.com/react@16/umd/react.development.js"></script> <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.min.js"></script>
Script Preparation code:
function Memo(props) { const handler = React.useMemo(() => { Math.random(); Math.random(); Math.random(); Math.random(); Math.random(); Math.random(); return _.debounce(props.handler, props.wait); }, [props.handler, props.wait]); return React.createElement("div", { className: handler() }); } function NoMemo(props) { Math.random(); Math.random(); Math.random(); Math.random(); Math.random(); Math.random(); const handler = _.debounce(props.handler, props.wait); return React.createElement("div", { className: handler() }); } var propCases = [{ handler: function() { return Math.random(); }, wait: 100 }, { handler: function() { return Math.random(); }, wait: 200 }]; propCases.push(propCases[1]);
Tests:
memo
propCases.forEach((props, i) => { ReactDOM.render(React.createElement(Memo, props, null), root); });
no
propCases.forEach((props) => { ReactDOM.render(React.createElement(NoMemo, props, null), root); });
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
memo
no
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
React Memo or No Memo
useMemo and memo
Memoization + useCallback (II)
MemoTest
Comments
Confirm delete:
Do you really want to delete benchmark?