$ time tiddlywiki --version
5.1.21
real 1m2,309s
user 1m2,727s
sys 0m0,511s
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/34128edc-f5b0-4154-9077-2d38e79d1eee%40googlegroups.com.
Hi FlorianDo you have a large number of tiddlers in your wiki?The startup time under Node.js hasn’t had much optimisation attention, and I think there’s quite a lot of scope to improve things.Best wishes
Jeremy.
On 6 Dec 2019, at 11:33, Florian Cauvin <floria...@gmail.com> wrote:
On my RaspberryPi 3 with Raspian and NodeJs:$ time tiddlywiki --version
5.1.21
real 1m2,309s
user 1m2,727s
sys 0m0,511sOnce TiddlyWiki is "loaded" it works well and is responsive.... but >1 minute to start up? Is that normal???--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6513caf7-b1a4-4290-8abb-4718c3c9e292%40googlegroups.com.
The first is that evalSandboxed (in boot.js) runs every module in a new context. If you change it to all of them using one separate context which you create outside the function, it should speed things up some. This one may vary between node versions, but it's worth a shot.
The second is loading the hundreds of tiddlers that make up the core. There is a feature of the boot process that fixes this. Replace the contents of the core folder with this file (assuming your using Tiddlywiki5.1.21) https://github.com/Arlen22/TiddlyWiki5-production/blob/master/5-1-21/core/plugin.info. That way it's just loading one file and doing a simple JSON.parse.
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/654d317b-af72-4e89-aa71-2ceabb26c17a%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/629be1bd-3763-419a-a5a7-dd94d3679b1f%40googlegroups.com.
that would mean something is broken then?
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f7b1fc7c-68bf-4db5-8cfb-5de854b3e78d%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b987363a-17f2-4444-8bb9-d6aa43c7b841%40googlegroups.com.
Ok, here's the evalSandboxed code currently. Well, almost, there is one change inside the function, but just ignore that./*Run code in a sandbox with only the specified context variables in scope*/$tw.utils.evalSandboxed = $tw.browser ? $tw.utils.evalGlobal : function(code,context,filename) {var sandbox = $tw.utils.extend(Object.create(null),context);vm.runInNewContext(code,sandbox,$tw.utils.evalFilename(filename));return sandbox.exports;};In the first line, change $tw.browser to true, like this:/*Run code in a sandbox with only the specified context variables in scope*/$tw.utils.evalSandboxed = true ? $tw.utils.evalGlobal : function(code,context,filename) {var sandbox = $tw.utils.extend(Object.create(null),context);vm.runInNewContext(code,sandbox,$tw.utils.evalFilename(filename));return sandbox.exports;};See if that improves anything.Arlen
On Fri, Dec 6, 2019 at 10:28 AM Florian Cauvin <floria...@gmail.com> wrote:
--Thanks Arlen for the suggestions:The first is that evalSandboxed (in boot.js) runs every module in a new context. If you change it to all of them using one separate context which you create outside the function, it should speed things up some. This one may vary between node versions, but it's worth a shot.I located the file and function call you're refering to but I'm not familiar with Javascript, Node, or the internals of TiddlyWiki. Thus I don't feel confident trying to modify that code. Hopefully, a TiddlyWiki developer could look into this?The second is loading the hundreds of tiddlers that make up the core. There is a feature of the boot process that fixes this. Replace the contents of the core folder with this file (assuming your using Tiddlywiki5.1.21) https://github.com/Arlen22/TiddlyWiki5-production/blob/master/5-1-21/core/plugin.info. That way it's just loading one file and doing a simple JSON.parse.Alright, I replaced all content of /usr/local/lib/node_modules/tiddlywiki/core with that file you linked to. It seems to have shaved a few seconds off the startup time which remained over 56 seconds, so while it seems to help a bit, there seems to be a larger issue.
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/2495b4d0-ff89-474e-8c67-ffae52549c9e%40googlegroups.com.