Closed GoogleCodeExporter closed 9 years ago
Giving this a go.
Not 100% sure bit I think three Web Workers would suffice:
Worker #1 for indexing everything, would solve issue #15, as scores could be
calculated without needing to worry about freezing Fauxbar (though this would
still only be done when the computer becomes idle, but it'd be okay if the user
started using Fauxbar again mid-index). Would only need to be created when
performing entire reindexes.
Worker #2 for background functions, like capturing screenshots and listening
for Chrome events.
Worker #3 for helping out Fauxbar's main page and UI. Main page would use
chrome.getBackgroundPage() and access the worker from there. Assuming the
initial call to chrome.getBackgroundPage() is lag-free, might not need to load
as many scripts when the page loads (maybe). Would also make things easier to
debug (WebKit doesn't do a very good job of debugging Ajax-loaded scripts).
All in all, when the computer becomes idle after a minute, Workers could be
destroyed and recreated, resetting memory, without needing a second extension
to do so. This does not resolve the problem of memory increasing for whatever
reason, but would reset it in a much nicer way than Fauxbar Memory Helper.
Original comment by fauxbar....@gmail.com
on 12 Dec 2011 at 1:20
Having played with this a little now, it seems SharedWorkers don't log any
errors yet :/
http://code.google.com/p/chromium/issues/detail?id=36577
http://code.google.com/p/chromium/issues/detail?id=105001
http://code.google.com/p/chromium/issues/detail?id=105004
Dedicated workers seemed okay, however these don't appear to create their own
process in Chrome's task manager, so measuring success of memory usage would be
too hard.
A dedicated worker for indexing is still a good idea, but a low priority.
Merging this into issue #2. A good learning experience nonetheless.
Original comment by fauxbar....@gmail.com
on 12 Dec 2011 at 4:05
Original issue reported on code.google.com by
fauxbar....@gmail.com
on 11 Dec 2011 at 2:15