Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ember-href-to performance tests #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

GavinJoyce
Copy link
Owner

Here are some simple performance tests for the ember-href-to Ember cli addon.

On my machine, {{href-to}} is 12x faster than {{link-to}} in Ember 1.13.4 and 6x faster in Ember 1.11.3:

image

(9.44 - 7.76) = 1.68ms
(27.95 - 7.76) = 20.19ms

12x faster in Ember 1.13.4

image

(7.43 - 6.21) = 1.22ms
(14.26 - 6.21) = 8.05ms

6x faster in Ember 1.11.3
var template =
    "{{#link-to 'index'}}Home{{/link-to}}" +
    "{{#link-to 'about'}}About{{/link-to}}" +
    "{{#link-to 'contact-us'}}Contact Us{{/link-to}}" +
    "{{#link-to 'index' (query-params a='aaa' b='bbb' c='ccc')}}Home with query params{{/link-to}}" +
    "{{#link-to 'parent.child1'}}Parent Child 1{{/link-to}}" +
    "{{#link-to 'parent.child2'}}Parent Child 2{{/link-to}}" +
    "{{#link-to 'parent.child3'}}Parent Child 3{{/link-to}}" +
    "{{#link-to 'contacts.contact.details' view.contact1}}Contact 1{{/link-to}}" +
    "{{#link-to 'contacts.contact.details' view.contact2}}Contact 2{{/link-to}}" +
    "{{#link-to 'contacts.contact.details' view.contact3}}Contact 3{{/link-to}}";
 var template =
    "<a href=\"{{href-to 'index'}}\">Home</a>" +
    "<a href=\"{{href-to 'about'}}\">About</a>" +
    "<a href=\"{{href-to 'contact-us'}}\">Contact Us</a>" +
    "<a href=\"{{href-to 'index' (query-params a='aaa' b='bbb' c='ccc')}}\">Home with query params</a>" +
    "<a href=\"{{href-to 'parent.child1'}}\">Parent Child 1</a>" +
    "<a href=\"{{href-to 'parent.child2'}}\">Parent Child 2</a>" +
    "<a href=\"{{href-to 'parent.child3'}}\">Parent Child 3</a>" +
    "<a href=\"{{href-to 'contacts.contact.details' view.contact1}}\">Contact 1</a>" +
    "<a href=\"{{href-to 'contacts.contact.details' view.contact2}}\">Contact 2</a>" +
    "<a href=\"{{href-to 'contacts.contact.details' view.contact3}}\">Contact 3</a>";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant