Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Benchmark: minify/concat javascript load times when injecting content scripts via Chrome extension
Does minifying/concating JS files make a difference if you're loading files via a chrome extension - since it loads js files from disk and not over network?
load = loading files from disk (not network since via extension)
execute = time from injecting <script> tags to when all variables are loaded and functions are executing
ready = all JS/HTML/CSS are finished loading aka jquery document.ready
Injecting 10x files into
total size: 260kb
load: 30-35 ms
executes: 430-1090 ms
ready: ~10238 ms = 10 seconds
Injecting 1x concatenated file into
total size: 180kb
load: 2-3 ms
execute: 367-908 ms
ready: ~8200 ms = 8.2 seconds
While percentage-wise it seems significant, it wont make a big difference in terms of UX since the times are in ms and the difference is <1s.
Note: 'ready' includes all of Gmail js/css/html assets which takes a LONG time to load and the numbers varied wildly. So that is less significant than the load/execute counts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.