Editing jQ.Mobi This edit will create a new revision. Your details (optional) Name Email (won’t be displayed; might be used for Gravatar) URL Test case details Title * Published (uncheck if you want to fiddle around before making the page public) Description (in case you feel further explanation is needed)(Markdown syntax is allowed) This is an edited test from http://jsperf.com/jqm3/26 by @DevinRhode2 I added a raw JS baseline, and another test that uses javascript prototypes to create some jquery-like abstraction, but yield nearly the same performance as raw JS. This makes one consider the *Prototype* javascript library. In attempting to add the Prototype version, I decided that it's too different, even as a pretty well versed javascript developer. From: http://api.prototypejs.org/dom/Element/new/, a Prototype test case would look something like this: var ul = new Element('ul').update("<li>Hello PrototypeJS world, you're strange."); .update? .text or .innerText are far too commonplace, and .update truly threw me for a second. PrototypeJS is great, but I'd rather see a jQ.Mobi re-write that heavily uses prototypes of native objects. By my investigation on their docs site, prototypes don't seem modified at all. I'm curious about the feasibility of a jQ.Mobi re-write that heavily uses prototypes Are you a spammer? (just answer the question) Preparation code Preparation code HTML (this will be inserted in the <body> of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <script src="//staging-ian.appmobi.com/game/zepto.min.js"></script> <script src="//staging-ian.appmobi.com/game/jq.mobi.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script><div id="container"></div> Include JavaScript libraries as follows: <script src="//cdn.ext/library.js"></script> Define setup for all tests (variables, functions, arrays or other objects that will be used in the tests) (runs before each clocked test loop, outside of the timed code region) (e.g. define local test variables, reset global variables, clear canvas, etc.) (see FAQ) var d = {}; d.id = function(el) { return document.getElementById(el); } d.create = function(el) { return document.createElement(el); } //Lets add the append method to all html dom nodes: HTMLElement.prototype.append = function(el) { this.appendChild(el); } var container = d.id('container'); var ul, li, i = 0; Define teardown for all tests (runs after each clocked test loop, outside of the timed code region) (see FAQ) container.innerHTML = ""; Code snippets to compare Test 1 Title Async (check if this is an asynchronous test) Code ul = jq("<ul/>"); for (; i < 100; i += 1) { li = jq("<li>hello world jq.Mobi</li>"); ul.append(li); } jq(d.id('container')).append(ul); Test 2 Title Async (check if this is an asynchronous test) Code ul = jQuery("<ul/>"); for (; i < 100; i += 1) { li = jQuery("<li>hello world jQuery</li>"); ul.append(li); } jQuery(d.id('container')).append(ul); Test 3 Title Async (check if this is an asynchronous test) Code ul = Zepto("<ul/>"); for (; i < 100; i += 1) { li = Zepto("<li>hello world Zepto</li>"); Zepto(ul).append(li); } Zepto(d.id('container')).append(ul); Test 4 Title Async (check if this is an asynchronous test) Code i, ul = document.createElement("ul"); for (; i < 100; i += 1) { li = document.createElement("li"); li.innerText = 'hello world raw JS'; ul.appendChild(li); } document.getElementById("container").appendChild(ul); Test 5 Title Async (check if this is an asynchronous test) Code ul = d.create("ul"); for (; i < 100; i += 1) { li = d.create("li"); li.innerText = 'hello world almost raw JS'; ul.append(li); } d.id("container").append(ul);