JScript is slow, but you knew that ;) - RealWorld forums

Log-in or register.

JScript is slow, but you knew that ;)

PAEz
on October 18th 2013

This is a reply to Vlasta for this thread....
http://www.rw-designer.com/forum/2636
...Im putting it here as to not pollute that thread. Got the feeling they wanted just script posts in there.

Figured it was windows scripting and hoped aswell that installing IE 11 would speed it up, but alas, no.
Bumma too, as the new IE has some serious speed like all the browsers now...still lacking heaps but atleast their JS speed is up (nice to see webgl in there aswell and with massive speed! https://www.scirra.com/blog/125/internet-explorer-11-webgl-and-more ).

Be awesome if you could change it to something like spidermonkey (or woteva its called now) or V8 but Im guessing that would be a massive pain so no fuss. Even as it is the JS in the great app is just a joy.

So if its windows scripting (that I have no experience with), does this mean I could do things like bring up a file selection dialog and get them to open a file? One thing Id love to make if possible is a way to import a sprite off a sprite sheet packed with TexturePacker. This would involve opening a json file, parse it, and then bring up something asking which sprite they'd like to import and if bringing that up is a pain then just create a layer with the right name for each sprite. The cutting the images out of the sheets looks easy enough.

Ohwell, hope I dont come across like Im unsatisfied, Im extremely impressed with this app as free and cant believe Ive only just noticed it....very well done, thank you.

PS. WebP support! Awesome! Dont see that often enough. I use them when I make Chrome themes and sometimes I accidently save images off the web as webP and its great to have this (I have a little homemade web accelerator that recompresses all images as webP, Im dial up).

PAEz
on October 19th 2013

This sort of stuff is a little beyond me but I had a look around anyways.
Seems you can activate Chakra from your end....
http://stackoverflow.com/a/7367729/189093
...BUT, its not made to be completley compatible with all features of IActiveScript....
http://stackoverflow.com/questions/17472638/error-adding-scriptitem-codeonly-symbol-using-ie9-js-engine-chakra
...they have a new way of exposing the engine to win32 apps, but thats not the same is it and I would guess would add alot of work for you, so no go.
OhWell, its still cool :-)

PAEz
on October 19th 2013

Noticing that your updating the docs on JS...sweet!
Thanks mate, know how much it sux doing the docs :-)

urgggghhhhh, now Im going to have to update some of those scripts ;-)

Vlasta
on October 19th 2013

Thanks for doing the tests with the newer JS engines, it is disappointing that the newer engine is not exposed to 3rd party apps. Integrating a whole engine would be also possible, but beside the work needed to do it, it would probably increase the size of the whole app significantly and I try to keep it low.

I'll try to make the documentation more complete, there probably still are some things out of date.

PAEz
on October 19th 2013

The v8 engine isnt that big really.
The python implementation (PyV8) for instance is about 1.8 meg uncompressed and under 800k zipped. Maybe you where thinking of chromium embedded which is over 20 meg zipped!...sure is great tho, node-webkit is a freakn joy.
Its the work of integrating it with your stuff that I thought would be the downer, doesnt windows scripting make it easy to integrate with COM stuff? Wouldnt know if its the same for v8.
It would be awesome tho, being able to have that speed would be sweet.
But really, dont stress or anything, still very impressive what you have.

Vlasta
on October 24th 2013

I quickly checked out V8 and I guess it would be possible to use it and the extra size may be worth it. I see the greatest advantage not in speed, but in independence on Windows. Non-working scripting is currently the biggest problem of RWPaint used on Linux under Wine.

Still, the interface between the application and the JavaScript would need to be reimplemented and that would take a moderate amount of time, so I am not going to do it right now.

PAEz
on October 25th 2013

Cool, excited just to know your even thinking about it ;-)
Never thought of the Wine angle.
Another reason Id like it is just to have a full modern implementation of JS....I was shocked to find no native JSON for instance.
Thanks for all your attention, so nice to get this sort of feedback from the author of a free app....not something Id expect.

PAEz
on November 8th 2013

Just a little note for the future incase you do ever use another engine...
It'd be great if we could get the image as a typed array, would wonder if itd be faster than calling out with GetPixel and would make converting existing routines a breeze.

Page views: 1764       Posts: 8      
I wish there were...
Vista & Win 7 icons
What about ICL files?