Path: ...!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Mild Shock Newsgroups: comp.lang.prolog Subject: Re: Will WASM be fast some time? (Was: thank you for the FLOPs) Date: Tue, 4 Mar 2025 10:13:40 +0100 Message-ID: References: <1b7ce2bd-722b-4c2e-b853-12fc2232752bn@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 4 Mar 2025 09:13:40 -0000 (UTC) Injection-Info: solani.org; logging-data="1097853"; mail-complaints-to="abuse@news.solani.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0 SeaMonkey/2.53.20 Cancel-Lock: sha1:zsKw3gdmEl1vsyS33BdShaji02E= X-User-ID: eJwNy8EBwCAIA8CVakIAx0Eq+4/Q3v9EX95hLjeNJp8dBz19bhbdri52q0Db4IPElLEmctYbtSqPZfl/0CL9A1NEFTE= In-Reply-To: Bytes: 3939 Lines: 65 Hi, I made a test, you can run it from here, its CORS enabled: :- ['https://www.dogelog.ch/module/bench/suite.pl']. :- suite. First a WASM Prolog, showing warm run: nrev % 2,995,946 inferences, 1.417 CPU in 1.417 seconds crypt % 4,169,360 inferences, 2.776 CPU in 2.776 seconds deriv % 2,100,600 inferences, 1.555 CPU in 1.555 seconds poly % 2,088,942 inferences, 1.681 CPU in 1.681 seconds sortq % 3,627,136 inferences, 1.923 CPU in 1.923 seconds tictac % 1,013,322 inferences, 2.659 CPU in 2.659 seconds queens % 4,599,283 inferences, 2.496 CPU in 2.496 seconds query % 8,645,933 inferences, 5.189 CPU in 5.189 seconds mtak % 3,946,569 inferences, 1.642 CPU in 1.642 seconds perfect % 3,243,474 inferences, 1.498 CPU in 1.498 seconds calc % 3,062,293 inferences, 1.791 CPU in 1.791 seconds https://wasm.swi-prolog.org/wasm/tinker Then a JavaScript Prolog, showing warm run: nrev % Zeit 1413 ms, GC 0 ms, Lips 2127790, Uhr 04.03.2025 10:00 crypt % Zeit 1204 ms, GC 0 ms, Lips 3461555, Uhr 04.03.2025 10:00 deriv % Zeit 1270 ms, GC 0 ms, Lips 3094644, Uhr 04.03.2025 10:00 poly % Zeit 1068 ms, GC 0 ms, Lips 2336682, Uhr 04.03.2025 10:00 sortq % Zeit 1595 ms, GC 0 ms, Lips 2667571, Uhr 04.03.2025 10:00 tictac % Zeit 1596 ms, GC 0 ms, Lips 1087015, Uhr 04.03.2025 10:00 queens % Zeit 1718 ms, GC 0 ms, Lips 3322441, Uhr 04.03.2025 10:00 query % Zeit 2764 ms, GC 0 ms, Lips 3132399, Uhr 04.03.2025 10:00 mtak % Zeit 2129 ms, GC 8 ms, Lips 3936434, Uhr 04.03.2025 10:00 perfect % Zeit 1415 ms, GC 0 ms, Lips 3317768, Uhr 04.03.2025 10:00 calc % Zeit 1314 ms, GC 0 ms, Lips 2922571, Uhr 04.03.2025 10:00 https://www.xlog.ch/runtab/doclet/docs/04_tutor/basic/example01/package.html Whats the cause of the discrepancy? 32-bit? Auto-Yield? Bye Mild Shock schrieb: > Hi, > > I wonder wether WASM will be fast some time. > I found this paper which draws a rather dim picture, > but the paper is already a little bit old: > > Understanding the Performance of WebAssembly Application > Weihang Wang et al. - 2021 > https://weihang-wang.github.io/papers/imc21.pdf > > The take away is more or less that jitted JavaScript has > same speed as WASM. With sometimes WASM more favorable > outcome for Firefox than for Chrome and Edge: > > Java Script     Chrome    Firefox    Edge > D.1 Exec. Time (ms)    45.57    48.26    63.62 > M.2 Exec. Time (ms)    249.60    167.03    201.68 > > WASM    Chrome    Firefox    Edge > D.1 Exec. Time (ms)    65.23    39.65    83.53 > M.2 Exec. Time (ms)    233.08    345.98    192.87 > > Bye