newLISP in a browser

Started by Lutz, January 02, 2014, 01:43:18 PM

Previous topic - Next topic

HPW

#90
Hello fdb,



Good to hear that get it working with latest newlisp version.

Could you upload the resulting js somewhere so others can also test with it. (Until Lutz offer a new one)



(I hope Lutz is thinking about the WebAssembly option)



Regards



Hans-Peter
Hans-Peter

fdb

#91
Hi Hans-Peter,



Made the js  (and .mem file)  available to download from here: http://www.ferrydb.nl/newlisp/download">www.ferrydb.nl/newlisp/download



BR

Ferry

Lutz

#92
Thanks for doing this work Ferry:



http://www.ferrydb.nl/newlisp/">http://www.ferrydb.nl/newlisp/



I also updated the 'info' file to newlisp-js-10.7.3.zip reference here:



http://www.newlisp.org/newlisp-js/">http://www.newlisp.org/newlisp-js/



The zip file contains the whole newlisp-js directory including the codemirror editor files.



The -s MAX_SETJMPS=100 setting in the makefile was done originally to save memory on mobile devices. This doesn't seem to be an issue anymore. Your compile runs fine on my iPhone 6s.

HPW

#93
Hello Ferry and Lutz,



Thanks for providing the new release.

Works fine on all my firefox/chrome versions and IE11.

On Edge I will test later.



Lutz any new thoughts about the WebAssembly option?



Edit: Latest edge also works fine.



Regards
Hans-Peter

Lutz

#94
When I have more time, may be. There is very little interest in the browser version at all. Perhaps somebody else wants to do it: http://webassembly.org/docs/faq/">http://webassembly.org/docs/faq/

fdb

#95
Ok, i've managed to compile it to web assembly. - 'Just a switch...'  ;-)



I eventually found out where to put the switch in the build file and it works in Firefox and Chrome (not in Safari), haven't tested Explorer/Edge.



You can download newlisp-js-lib.js.wa and newlisp-js-lib.js.wasm from //ferrydb/newlisp/download, Lutz i've also added the make file i used. (makefile_emscripten_lib_utf8)



You have to rename newlisp-js-lib.js.wa to newlisp-js-lib.js and put in together with new lisp-js-lib.wasm in the document directory of your web server.



I've also done some performance tests with a small Scrabble program i wrote and it is really remarkable how fast JS/WA is compared to  native Newlisp (on iMac,  3.2Ghz Intel Core I3, 12 GB Ram). See below some results how long it takes to find the best solution in my little (naive/unoptimised/educational!) Scrabble program , (choosing from 35,000 words, having 5 letter and 2 jokers, 3 words already on the board).  



All examples run on  iMac OSX 10.12.5 (Sierra),  3.2Ghz Intel Core I3, 12 GB Ram (in minutes CPU time)



Native

5.5



Javascript

Firefox : 5

Chrome: 8

Safari Nightly: 8

Safari: 10



WebAssembly

Firefox: 4.5

Chrome:5.5

Lutz

#96
Great! will try it later.



You can check performance evaluating this:



(load "newlisp-js/qa-bench")



The file is loaded from the internal directory.



>>>>> total time: 821
>>>>> Performance ratio: 1.54 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)


Its 1.54 times slower in JavaScript on Firefox than natively. Currently running on a 2016 Macbook / macOS Sierra with very similar results. Chrome and Safari are much slower. It checks all non IO functions.

fdb

#97
You can try it at //ferrydb.nl/newlisp-wa/ results below, so only marginally faster(as you suspected).



>>>>> total time: 807
>>>>> Performance ratio: 1.52 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

fdb

#98
Results on my 2017 macbook pro (I7 ,2.7 ghz)



Firefox JS

>>>>> total time: 535

>>>>> Performance ratio: 1.08 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Chrome JS

>>>>> total time: 1397

>>>>> Performance ratio: 2.48 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Firefox Web Assembly

>>>>> total time: 511

>>>>> Performance ratio: 1.04 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Chrome Web Assembly

>>>>> total time: 594

>>>>> Performance ratio: 1.17 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

HPW

#99
Hello,



Thanks Ferry for providing the WebAssembly Option.



From my Win7 tablet (The middle of 3 measurements)



http://ferrydb.nl/newlisp/">http://ferrydb.nl/newlisp/



http://ferrydb.nl/newlisp-wa/">http://ferrydb.nl/newlisp-wa/



Asus Eee Slate

i5 U470 1.33 Ghz 4 Gb

Windows performance Index 3.1





(module "qa-bench")



IE 11.0.9600 JS



>>>>> total time: 41174

>>>>> Performance ratio:67.17 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



IE 11.0.9600 WA



Not compatibel





Chrome 59.0.3071.109 JS



>>>>> total time: 13724

>>>>> Performance ratio:22.52 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Chrome 59.0.3071.109 WA



>>>>> total time: 4920

>>>>> Performance ratio: 8.21 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)





Firefox 54.0 32bit JS



>>>>> total time: 6168

>>>>> Performance ratio:10.24 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Firefox 54.0 32bit WA



>>>>> total time: 5862

>>>>> Performance ratio: 9.74 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Regards
Hans-Peter

HPW

#100
Hello,



Another test on an aged WIN 1o Laptop



Core 2 duo P8400 2.26 Ghz 4GB

Windows 10 Pro 1703 32bit



Edga 40 JS



>>>>> total time: 3759

>>>>> Performance ratio: 6.32 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Edge 40 WA with enabled experimental javascript



ERR: regular expression in function find-all : "error -4 when executing"

called from user function QA:(qa)

called from user function (module "qa-bench")



So we see that WebAssembly is not yet everywhere. Best performance boost on chrome.



Regards
Hans-Peter

HPW

#101
Hello,



Another note for WIN XP:



Neither Chrome 49 or Firefox ESR 52.2.0 work with WebAssembly.

But the JS-flavour works.



Regards
Hans-Peter

HPW

#102
Hello,



CAD-Workstation:

Dell Precision T3610

CPU E5-1620 v2 3.7 GHZ 16GB

Windows performance index 7.7

WIndows 7 PRO SP1



http://www.ferrydb.nl/newlisp/">http://www.ferrydb.nl/newlisp/

http://www.ferrydb.nl/newlisp-wa/">http://www.ferrydb.nl/newlisp-wa/



(module "qa-bench")





Chrome 59 JS



>>>>> total time: 1832

>>>>> Performance ratio: 3.18 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Chrome 59 WA



>>>>> total time: 796

>>>>> Performance ratio: 1.50 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)





Firefox 54 JS



>>>>> total time: 1032

>>>>> Performance ratio: 1.88 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Firefox 54 WA



>>>>> total time: 990

>>>>> Performance ratio: 1.81 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Regards
Hans-Peter

fdb

#103
Hi,



i've now als run some test on my iPad Pro, running beta of IOS 11 and also Safari 11 which should be able to run web assembly, results below:



With javascript:

>>>> total time: 3139

>>>>> Performance ratio: 5.31 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



With web-assembly:

>>>>> total time: 1633

>>>>> Performance ratio: 2.86 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



So almost twice as fast with web assembly.

HPW

#104
Hello,



Latest emscripten: Emscripten 1.37.27 (December 29, 2017)



Firefox Quantum 57.0.3 64 bit with new impressive Performance on my tablet

Asus Eee Slate

i5 U470 1.33 Ghz 4 Gb

Windows performance Index 3.1

Tested on Ferry's pages with 1.37.14



With javascript:

http://ferrydb.nl/newlisp/">http://ferrydb.nl/newlisp/



>>>>> total time: 1891

>>>>> Performance ratio: 3.28 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



With web-assembly:

http://ferrydb.nl/newlisp-wa/">http://ferrydb.nl/newlisp-wa/



>>>>> total time: 1539

>>>>> Performance ratio: 2.71 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)



Much faster than the last test with Firefox 54 on that Hardware.



Regards
Hans-Peter