Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Function declaration vs Function expression in React
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
function expression
124348.6 Ops/sec
function declaration
83247.2 Ops/sec
HTML Preparation code:
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script> <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> <div id="dest"></div>
Tests:
function expression
const Hello = ({toWhat}) => React.createElement('div', null, `Hello ${toWhat}`); ReactDOM.render( React.createElement(Hello, {toWhat: 'World'}, null), document.getElementById('dest') );
function declaration
function Hello ({toWhat}) { return React.createElement('div', null, `Hello ${toWhat}`); } ReactDOM.render( React.createElement(Hello, {toWhat: 'World'}, null), document.getElementById('dest') );