This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use pure js url absolutification with resizeImage()
- Loading branch information
Showing
2 changed files
with
8 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9882642
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://jsperf.com/make-url-absolute-dom-vs-js/4 :\
9882642
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this faster for you on test devices? I just gave it a whirl on my desktop browser and found around 3x quicker...
9882642
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pure JS version runs like a dog on my first gen iPod touch, DOM version is like 3x faster, but this is a very ambitious full URL parser, John and Ryan pointed out ot me that we don't need to be this careful, we can, for instance, leave it to the browser to resolve ./ and ../, and we probably don't need to handle non http/https urls
9882642
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is performance of URL transformation really a critical component of overall processing? If not, we should use simplest possible implementation (DOM one). If you are handling enough URLs to make URL mangling time measurable, you have far bigger problems on your hands (such as load time of all that cornucopia of images).