Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
get navigation type
(version: 2)
Comparing performance of:
actual vs future vs direct
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
actual
var page_view_navigate, page_view_reload, page_view_back_forward; var type = performance.getEntriesByType('navigation')[0].type; var navigationType = function(type) { if (type === 'navigate') { page_view_navigate = 1; return '0'; } else if (type === 'reload') { page_view_reload = 1; return '1'; } else if (type === 'back_forward') { page_view_back_forward = 1; return '2'; } else { return '255'; } }; var page_reload = navigationType(type);
future
var getNavigationType = function () { var type = performance.getEntriesByType('navigation')[0].type; switch (type) { case 'navigate': return { pageViewNavigate: 1, value: '0' }; case 'reload': return { pageViewReload: 1, value: '1' }; case 'back_forward': return { pageViewBackForward: 1, value: '2' }; default: return { value: '255' }; } }; var navigationInfo = getNavigationType(); var page_view_navigate = navigationInfo.pageViewNavigate; var page_view_reload = navigationInfo.pageViewReload; var page_view_back_forward = navigationInfo.pageViewBackForward; var page_reload = navigationInfo.value;
direct
var page_view_navigate, page_view_reload, page_view_back_forward; var navigationType = function() { try { var type = performance.getEntriesByType('navigation')[0].type; if (type === 'navigate') { page_view_navigate = 1; return '0'; } else if (type === 'reload') { page_view_reload = 1; return '1'; } else if (type === 'back_forward') { page_view_back_forward = 1; return '2'; } else { return '255'; } } catch (error) { return '255'; } }; var page_reload = navigationType();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
actual
future
direct
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser/OS:
Chrome 131 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
actual
2265627.2 Ops/sec
future
2279480.5 Ops/sec
direct
2283240.0 Ops/sec
Related benchmarks:
Parse vs InnerHTML
ssssdsaddffvfggggff
ssssdsaddffvfggggfffdssff
jQuery (v1.12.4-wp) && Dom7 (4.0.4) Full (v2)
JS VS JQUERY leotest22
createContextualFragment vs appendChild
reate array by lenght
closest comparision
closest comparision 2
Comments
Confirm delete:
Do you really want to delete benchmark?