microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
710 stars 589 forks source link

play sound block consumes ~48 KBs of data #4941

Closed microbit-carlos closed 1 year ago

microbit-carlos commented 1 year ago

Describe the bug

Breaking out this specific issue from:

Looking at the binary.js size numbers from this programme, the size difference between removing or including the [play sound] block is ~48 KBs, which is quite a lot for something that would be mostly wrapping CODAL functionality.

https://makecode.microbit.org/_bfs6mzETmeUi

image

To Reproduce

Expected behavior A lower memory footprint for the block.

Screenshots N/A

micro:bit version (please complete the following information):

N/A

Desktop (please complete the following information): N/A

Smartphone (please complete the following information): N/A

Additional context

makecode.microbit.org version: 5.0.12 Microsoft MakeCode version: 8.0.7 microbit runtime version: v2.2.0-rc6 codal-microbit-v2 runtime version: v0.2.40

abchatra commented 1 year ago

@riknoll any idea

abchatra commented 1 year ago

@riknoll can you take a look at this? This came up from ElecFreaks accessory maker again.

riknoll commented 1 year ago

sure thing

riknoll commented 1 year ago

quick note: the 48kb number refers to binary.js size and not the compiled code size. To get an accurate number, you need to download the hex file and open the mbcodal.asm file that appears under the built folder. You can also add ?compiler=size to the url to get more detailed size information in that file.