<head>
<title>Hello World!</title>
<script src='//code.jquery.com/jquery-3.3.1.min.js'></script>
<script src='//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js'></script>
<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>Curonsys</h1>
</div>
<div data-role="content">
<p>Hello world</p>
</div>
<ul id="mylist" data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" data-count-theme="b">
<li data-role="list-divider">Divider</li>
<li><a href="#">Inbox <span class="ui-li-count">12</span></a></li>
<li><a href="#">Outbox <span class="ui-li-count">0</span></a></li>
<li><a href="#">Sent <span class="ui-li-count">328</span></a></li>
<input type="button" value="http://curonsys.com" id="curo" class="myButton" data-inline="true"/>
<input type="button" value="http://naver.com" id="nav" class="myButton" data-inline="true"/>
</ul>
</div>
</body>
var dirName;
var isRel;
var parseLocation;
$(document).ready(function() {
dirName = $.mobile.path.get($('curo').attr('value'));
});
$(document).ready(function() {
isRel = $.mobile.path.isRelativeUrl($('nav').attr('value'));
});
$(document).ready(function() {
parseLocation = $.mobile.path.parseLocation();
});
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
path | |
url | |
parseLocation |
Test name | Executions per second |
---|---|
path | 6027.1 Ops/sec |
url | 10859.7 Ops/sec |
parseLocation | 3702.1 Ops/sec |
I'll break down what's being tested in the provided JSON and explain the options, pros, cons, and other considerations.
Benchmark Definition
The benchmark is testing the performance of jQuery Mobile 1.4.5 when loaded on top of jQuery 3.3.1. The test consists of three cases:
$.mobile.path.isRelativeUrl()
function.$.mobile.path.parseLocation()
function.$.mobile.path.get()
function.Options Compared
The benchmark is comparing the performance of three different approaches:
isRel
function.isRel
function.parseLocation
variable, which is obtained by parsing a location using $.mobile.path.parseLocation()
.Pros and Cons
Library and Purpose
The $.mobile
library is used in this benchmark, which is part of jQuery Mobile. The purpose of this library is to provide a set of APIs for building mobile applications using HTML, CSS, and JavaScript.
Special JS Feature or Syntax
This benchmark does not appear to use any special JavaScript features or syntax that would affect its performance or behavior. However, it's worth noting that the $.mobile
library is specific to jQuery Mobile and may not work with other frameworks or libraries.
Other Considerations
The benchmark is designed to test the performance of the .mobile.path
functions in different scenarios. The use of relative URLs, absolute URLs, and URL parsing can affect the performance of these functions, and this benchmark aims to identify the most efficient approach for each scenario.
Alternatives
There are other alternatives to the $.mobile.path
functions, such as using native JavaScript APIs or third-party libraries like url-parser
. However, the $.mobile.path
functions are part of jQuery Mobile and provide a convenient and portable way to work with URLs and locations in mobile applications.