-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code size info #9517
Comments
Another report of code size regression. Related: microsoft/pxt-microbit#4808 |
@Mr-Meow-ZA Can I assume this is a microbit project? If so:
Can you share your project? |
@eanders-ms Thanks for the reply and the link to the related post.
The below all use File 1 as an example.
I'll remember to save projects in future when I encounter the issue again as these examples I reproduced now quick do not really show it that well. |
You may get some insight using a new url parameter available in beta that enables calculation of subsystem sizes in the hex: How to see the output:
; generated code sizes (bytes): 6908 (incl. 5008 user, 1274 helpers, 306 vtables, 320 lits); src size 0
...
;
; Code size:
;
; 566 helper: bind [_pxt_helper_bind]
; by helper: get [_pxt_helper_get]
; 436 radio/radio.ts(63,5): radio.handleDataReceived [radio_handleDataReceived__P3115]
; by radio/radio.ts(57,5): radio.init [radio_init__P3114]
; 338 _code_helper__conv_22 [_code_helper__conv_22]
; by many, including main.ts(24,15): inline
; 324 core/game.ts(780,5): game.plot [game_plot__P2999]
... |
@eanders-ms thank you very much! That is a very useful trick. I just tried it now and it worked great, I can also use this to estimate sizes by comparison. Going to play with it this week :) |
@Mr-Meow-ZA We made some improvements to code size, and I'm curious if it helps you here. The changes aren't public yet, but can you test your project with this private build and let us know if it works? |
@eanders-ms thanks for letting me know. I will check it out this week. Sounds promising :) |
@Mr-Meow-ZA these changes are released now and available at https://makecode.microbit.org. No need to test in the special build I linked. |
@eanders-ms that is fantastic, thanks again. It is definitely much better now |
Hi there,
I have often hit a hurdle where my code is too large and I get the warning saying the "program is too big by X bytes!"
But as there is no way of knowing which blocks are using up the most space it is very difficult to optimize the code or to know what to remove and what to leave.
If there was a way to determine or even estimate memory usage by blocks then it would make doing larger projects far easier!
The text was updated successfully, but these errors were encountered: