-
Notifications
You must be signed in to change notification settings - Fork 325
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
Performance of window.ipfs #460
Comments
I'll measure where the bottleneck is, but some ideas:
My hunch is that we can mitigate 3 by solving 1 and/or 2. |
My findings are as follows: On my circa 2014 MacBook Pro the content script currently take the following time to run:
If I remove
Which is >50% time saving. The problem is exacerbated on sites what have many iframes. For example, http://theregister.co.uk had 12 iframes when I ran the tests. The content scripts are run in serial, i.e. the next one does not start until the current one is finished. It means that I can actually see the adverts load in one after the other. I believe the time is being spent parsing the IPFS library - it's nearly 3MB of JS. My recommendation would be to remove adding the constructor N.B. I experimented with lazily establishing the IPC port from the content script to the background script but it has no significant effect on run time. Also, I checked with minified scripts and it also doesn't have a significant effect on run time. |
Thank you for looking into this!
I agree. It looks like it is barely used anyway. Some additional data for
And without
That is ~1.7MB difference (60%!) Will create PR shortly. Edit: PR is at #467
Just to clarify: no at all, or no effect on load time? Do we know what is impact on memory usage? I would suspect that every time extension is establishing a new port some memory goes away, and if we can avoid that, that would be great. |
I haven't taken any memory measurements, but we should probably do lazy IPC port anyway as there is an overhead. |
A note from
|
Q3 summary:
|
Content script is injected into every webpage, which comes at a price:
add-on/dist/contentScripts/ipfs-proxy/
is ~2.8MBThis raises some questions:
cc @alanshaw
Status
The text was updated successfully, but these errors were encountered: