Rendering blocks using wasm(golang)

98 views
Skip to first unread message

MrRedo Gaming

unread,
Mar 23, 2023, 10:43:27 AM3/23/23
to Blockly
I have a blockly site https://scratch-for-discord.com and after putting 1k+ blocks the website starts lagging so i wanted to render blocks using wasm(golang)

Beka Westberg

unread,
Mar 23, 2023, 11:36:22 AM3/23/23
to blo...@googlegroups.com
Hello!

It is not currently possible to render blocks using wasm :/ However! We have been doing a lot of work this quarter to make performance improvements. As one example: inserting blocks into stacks is 5x faster!

So I would recommend upgrading to the next release (happening at the end of March) and seeing if that improves things for you =)

I'll also note that I'm not sure using wasm would actually improve the performance that much :/ The two most expensive parts of rendering are (1) the dom manipulations (e.g. `setAttribute` and `appendChild`) and (2) the actual rendering + painting done by the browser.

I hope that information is helpful! If you have any further questions please reply =)
--Beka

On Thu, Mar 23, 2023 at 7:43 AM MrRedo Gaming <rihards...@gmail.com> wrote:
I have a blockly site https://scratch-for-discord.com and after putting 1k+ blocks the website starts lagging so i wanted to render blocks using wasm(golang)

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/81c9ee54-372d-4ff5-a0cc-b5d46878f4bfn%40googlegroups.com.

Neil Fraser

unread,
Mar 23, 2023, 11:45:00 AM3/23/23
to blo...@googlegroups.com
The exception might be the connection database.  That's a small, fairly CPU intensive chunk of code that doesn't have any API calls.  Would love to explore whether wasm would help with that.



--
Neil Fraser, Switzerland
https://neil.fraser.name
Reply all
Reply to author
Forward
0 new messages