Comments (11)
Hi retroj, thanks for reporting this bug.
There's another workaround in my fork:
rpl@28a9b1d
We are evaluating which one has less impact on the xulrunner runtime.
Thanks again,
Luca
from mozrepl.
Ah, I see you used the method of altering the name of the temp file for each load. The reason we didn't do this in our situation is that it would lead to growing the startup cache larger and larger over the life of the program. That is something to consider. If you do go that way, I wouldn't use Math.random() because that won't guarantee uniqueness, only randomness, and random failure is the worst kind of failure! :-)
from mozrepl.
You're right about the side effects of that workaround and that are the reasons we've not merged it :-(
About cache invalidation: it's possible to do a more selective cleanup? invalidate all the cache content
could generate some other negative side effects?
from mozrepl.
Annoyingly, Mozilla doesn't provide a way to invalidate a single item in the startup cache. Even the fact that startup cache invalidation works through an observer rather than there being a complete interface (an nsIStartupCacheManager or whatnot) makes one wonder if this feature was more tacked on than planned. Perhaps this should be brought to Mozilla's attention as a feature request.
The drawback to invalidating the startup cache is the loss of the efficiency it provides with repeat loading of js files. Other than that, there are no side effects. I would choose this method, myself, because although it is a blunt instrument, it is still the right instrument, according to the intent of the design of the startup cache. That design may be flawed, but that's Mozilla's problem.
from mozrepl.
In cb151c0 and 552ed9b I'm adopting a hybrid approach—cache is flushed when the JavaScript interactor starts, then a new script is cached every time the REPL evaluates something. This should prevent the cache from growing indefinitely.
A more correct behavior would be to flush the cache when the interactor stops, or even better to flush the cache when the browser quits and the REPL is found to have been running. Consider this a quick fix.
I haven't looked much into the cache implementation, but certainly it will have some expiry mechanism? @retroj have you seen anything about that?
from mozrepl.
Here is a link: http://mxr.mozilla.org/mozilla-central/source/startupcache/StartupCache.cpp#487
from mozrepl.
Oh look, there is an idl: http://mxr.mozilla.org/mozilla-central/source/startupcache/nsIStartupCache.idl
from mozrepl.
I find Cc["@mozilla.org/startupcache/cache;1"] exists but Ci.nsIStartupCache does not. Puzzled. Perhaps it isn't scriptable.
from mozrepl.
@retroj I was thinking "automatic expiry". I think there ought to be one as otherwise the cache would get bigger and bigger regardless of MozRepl. I'll look into it at some point.
from mozrepl.
can u make one new .xpi pack with this patch?
rpl@28a9b1d
if i trying change repl.jx myself - it was crashed...
from mozrepl.
Current repo contains a workaround already, it will be in the next xpi.
On Tue, Nov 15, 2011 at 2:08 PM, BlackSnow98
[email protected]
wrote:
can u make one nex .xpi pack with this patch?
rpl@28a9b1d
if i trying change repl.jx myself - it was crashed...
Reply to this email directly or view it on GitHub:
#21 (comment)
from mozrepl.
Related Issues (20)
- node.js module please?
- No longer supports Thunderbird HOT 1
- Execute javascript in current web page context HOT 1
- In Firefox 25 on Ubuntu, document.cookie is undef in spite of active cookies
- websocket mode HOT 5
- Where is it in Firefox 29? HOT 3
- Changing focus from inspector window to main window
- Start the repl on Windows?
- Link to library of Bash functions for driving Mozrepl
- Feature request: REPL for add-on debugging
- window.document.URL returning browser URL HOT 4
- Why not put the temporary file in a temporay directory?
- Broken instructions for starting the REPL HOT 3
- Error "Exposing privileged or cross-origin callable is prohibited" HOT 1
- MozRepl add on does not work with FF55 HOT 4
- content always null when I'm use Firefox nightly builds.
- Dose not work on Firefox 55 HOT 2
- programmatically activate on startup
- Not Compatible with Firefox Quantum
- Alternatives? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mozrepl.