Sarkath
Active Member
- Sep 8, 2019
- 547
- 949
- 245
Things might have improved since the last time I looked at it (it's been well over a year since I've really done a deep dive on the source), but the way the JS engine was called before wasn't very efficient. If I remember correctly, it would set up and tear down the interpreter every time it ran an expression. That is, anything contained within square brackets in the XML, such as "[npc.Name] takes a closer look at [npc.herself]". Plus, "npc.Name" and "npc.herself" would both be evaluated by a heavy JS parser, which is quite heavy.i don't really get what you mean by that
the data IS parsed, all of it takes about 100ms tops, but the biggest slowdown is the webui loading the raw html text, the average screen is about 500k characters and it takes over 500-1000ms to display it
It's only really used for variable substitution and simple evaluations. Replacing it with a lighter-weight expression parser (Spring EL) sped things up a bit, especially in more complex scenes. I just ran out of free time and couldn't properly test it while the project steamrolled on, lol.
I was honestly kind of surprised at how old and clunky JavaFX's WebKit build seems to be. JxBrowser seems like it would be a good replacement in this case, perhaps with JFX controls for other parts of the UI.aight, i did some checkins and can tell you can't do shit to fix that unless you entirely change stuff for things like JxBrowser and other html renderers that can multithread, render with GPU acceleration and other stuff
JxBrowser also has its own JS engine. I wonder if that could be used independently of the rendering engine, and if it would outperform Nashorn. Might be worth looking into.