compiler, runtime: support pretty much all panic/recover functionality#5438
compiler, runtime: support pretty much all panic/recover functionality#5438jakebailey wants to merge 7 commits into
Conversation
|
unfortunately, this has a pretty negative size impact; I have not done the work to pin down specifically what does it, or added toggles to disable some of this, Size difference with the dev branch: Binary size differenceflash ram before after diff before after diff 4628 4804 176 3.80% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setpixel/main.go 4400 4900 500 11.36% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/easystepper/main.go 6356 6868 512 8.06% 2300 2300 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13/main.go 7068 7584 516 7.30% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/gc9a01/main.go 5896 6412 516 8.75% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1331/main.go 6248 6764 516 8.26% 2300 2300 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd4in2/main.go 5528 6052 524 9.48% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/customchar/main.go 5568 6092 524 9.41% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/text/main.go 15980 16508 528 3.30% 2340 2340 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hub75/main.go 5944 6516 572 9.62% 2292 2292 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13x/main.go 7032 7684 652 9.27% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=hifive1b ./examples/ssd1351/main.go 71612 72352 740 1.03% 3640 3640 0 0.00% tinygo build -size short -o ./build/test.hex -target=pinetime ./examples/bma42x/main.go 29080 29880 800 2.75% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/alarms/main.go 5510 6316 806 14.63% 8918 9006 88 0.99% tinygo build -size short -o ./build/test.bin -target=m5stamp-c3 ./examples/ws2812 33144 33956 812 2.45% 7408 7408 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/ssd1289/main.go 27492 28312 820 2.98% 5852 5852 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit-v2 ./examples/microbitmatrix/main.go 27572 28400 828 3.00% 3808 3808 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/microbitmatrix/main.go 21604 22492 888 4.11% 3532 3532 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/time/main.go 42956 43896 940 2.19% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/basic/main.go 43896 44892 996 2.27% 7736 7736 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/tmc2209/main.go 68336 69364 1028 1.50% 6852 6852 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/uart/main.go 67636 68696 1060 1.57% 6704 6704 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/i2c/main.go 42360 43420 1060 2.50% 8964 8964 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/sx127x/lora_rxtx/ 37404 38492 1088 2.91% 6604 6604 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8523/ 66832 68020 1188 1.78% 9368 9368 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/flash/console/qspi 62520 63708 1188 1.90% 6332 6332 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/max6675/main.go 62096 63340 1244 2.00% 8576 8576 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/i2csoft/adt7410/ 122808 124068 1260 1.03% 8112 8112 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/lora/lorawan/atcmd/ 62780 64072 1292 2.06% 6296 6296 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/is31fl3731/main.go 103740 105056 1316 1.27% 10408 10408 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-m4-airlift -stack-size 8kb ./examples/net/socket/ 65724 67056 1332 2.03% 6544 6544 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmi160/main.go 70472 71836 1364 1.94% 7328 7328 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/flash/console/spi 263400 264764 1364 0.52% 47108 47108 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/slideshow 57420 58784 1364 2.38% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht3x/main.go 57420 58784 1364 2.38% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/shtc3/main.go 57412 58784 1372 2.39% 3680 3680 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht4x/main.go 61840 63220 1380 2.23% 6528 6528 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adt7410/main.go 3113 4493 1380 44.33% 560 581 21 3.75% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/servo 1997 3377 1380 69.10% 600 621 21 3.50% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/ws2812 64396 65784 1388 2.16% 6568 6568 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp280/main.go 73864 75260 1396 1.89% 11108 11108 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/sdcard/console/ 1488 2889 1401 94.15% 182 203 21 11.54% tinygo build -size short -o ./build/test.hex -target=digispark ./examples/ws2812 68440 69860 1420 2.07% 7404 7404 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mcp9808/main.go 117132 118576 1444 1.23% 13704 13704 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webclient/ 65388 66872 1484 2.27% 6600 6600 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ndir/main_ndir.go 62036 63528 1492 2.41% 3768 3768 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ndir/main_ndir.go 68744 70260 1516 2.21% 7436 7436 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/ndir/main_ndir.go 120160 121692 1532 1.27% 12516 12516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2350 -stack-size 8kb ./examples/net/ntpclient/ 71424 72996 1572 2.20% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/alarm/ 76572 78192 1620 2.12% 7804 7804 0 0.00% tinygo build -size short -o ./build/test.hex -target=p1am-100 ./examples/p1am/main.go 77060 78688 1628 2.11% 6680 6680 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/dht/main.go 88024 89660 1636 1.86% 7756 7756 0 0.00% tinygo build -size short -o ./build/test.hex -target=challenger-rp2040 ./examples/net/ntpclient/ 71852 73496 1644 2.29% 6584 6584 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp2515/main.go 70860 72504 1644 2.32% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/time/ 71256 72924 1668 2.34% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/timer/ 7356 9072 1716 23.33% 2296 2296 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/at24cx/main.go 26188 27912 1724 6.58% 2304 2304 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/lsm303agr/main.go 9312 11040 1728 18.56% 5232 5232 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-l432kc ./examples/aht20/main.go 6244 8140 1896 30.37% 3268 3268 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setbuffer/main.go 120616 122556 1940 1.61% 8428 8428 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 -stack-size 8kb ./examples/net/tcpclient/ 167088 169068 1980 1.19% 10432 10432 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-mkrwifi1010 -stack-size 8kb ./examples/net/tlsclient/ 174808 176852 2044 1.17% 14516 14516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2040 -stack-size 8kb ./examples/net/tlsclient/ 156544 158764 2220 1.42% 9384 9384 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/mqttclient/natiu/ 346316 348944 2628 0.76% 22440 22424 -16 -0.07% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/mqttclient/paho/ 353292 356144 2852 0.81% 17376 17376 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal -stack-size 8kb ./examples/net/http-get/ 345076 348432 3356 0.97% 22468 22468 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webserver/ 315056 318508 3452 1.10% 16664 16648 -16 -0.10% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/websocket/dial/ 396524 400384 3860 0.97% 19420 19404 -16 -0.08% tinygo build -size short -o ./build/test.hex -target=matrixportal-m4 -stack-size 8kb ./examples/net/webstatic/ 23892 30520 6628 27.74% 5952 6000 48 0.81% tinygo build -size short -o ./build/test.hex -target=metro-rp2350 ./examples/bno08x/i2c/main.go 22680 29716 7036 31.02% 7268 7316 48 0.66% tinygo build -size short -o ./build/test.hex -target=pico ./examples/w5500/main.go 32068 39268 7200 22.45% 5120 5168 48 0.94% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bme280/main.go 17792 25012 7220 40.58% 7568 7616 48 0.63% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/as560x/main.go 27860 35096 7236 25.97% 7168 7216 48 0.67% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/lsm303dlhc/main.go 8816 16068 7252 82.26% 7128 7176 48 0.67% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/fourwire/main.go 12348 19612 7264 58.83% 7324 7372 48 0.66% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go 13140 20404 7264 55.28% 4924 4972 48 0.97% tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/sx126x/lora_rxtx/ 27664 35112 7448 26.92% 5120 5168 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp180/main.go 11372 18828 7456 65.56% 6928 6976 48 0.69% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/apds9960/proximity/main.go 14248 21712 7464 52.39% 6928 6976 48 0.69% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/hts221/main.go 13632 21096 7464 54.75% 6928 6976 48 0.69% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/lps22hb/main.go 9640 17104 7464 77.43% 4880 4928 48 0.98% tinygo build -size short -o ./build/test.hex -target=circuitplay-bluefruit ./examples/tone 7720 15188 7468 96.74% 3336 3384 48 1.44% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/sram/main.go 24636 32112 7476 30.35% 14076 14124 48 0.34% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840-sense ./examples/waveshare-epd/epd1in54/main.go 12344 19824 7480 60.60% 8712 8760 48 0.55% tinygo build -size short -o ./build/test.hex -target=xiao-ble ./examples/ssd1306/ 29436 36924 7488 25.44% 38424 38472 48 0.12% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/pyportal_boing 13096 20648 7552 57.67% 5948 5996 48 0.81% tinygo build -size short -o ./build/test.hex -target=qtpy-rp2040 ./examples/seesaw/rotary-encoder 16392 23944 7552 46.07% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/microphone/main.go 13388 20940 7552 56.41% 5916 5964 48 0.81% tinygo build -size short -o ./build/test.hex -target=pico ./examples/qmi8658c/main.go 14020 21576 7556 53.89% 5956 6004 48 0.81% tinygo build -size short -o ./build/test.hex -target=pico ./examples/ens160/main.go 10156 17716 7560 74.44% 7264 7312 48 0.66% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/basic 10188 17752 7564 74.24% 7256 7304 48 0.66% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/scroll 11720 19284 7564 64.54% 5968 6016 48 0.80% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/scd4x/main.go 15772 23340 7568 47.98% 5088 5136 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go 14328 21904 7576 52.88% 5088 5136 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go 11792 19376 7584 64.31% 5940 5988 48 0.81% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/seesaw/soil-sensor 16784 24368 7584 45.19% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/thermistor/main.go 18308 25916 7608 41.56% 6784 6832 48 0.71% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/adafruit4650 13636 21248 7612 55.82% 7136 7184 48 0.67% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/amg88xx 13280 20892 7612 57.32% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis2mdl/main.go 11544 19156 7612 65.94% 5908 5956 48 0.81% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu6886/main.go 11068 18680 7612 68.77% 5900 5948 48 0.81% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu9150/main.go 15264 22884 7620 49.92% 6012 6060 48 0.80% tinygo build -size short -o ./build/test.hex -target=pico ./examples/sgp30 12524 20144 7620 60.84% 5900 5948 48 0.81% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8591/ 13680 21308 7628 55.76% 5964 6012 48 0.80% tinygo build -size short -o ./build/test.hex -target=pico ./examples/pca9685/main.go 11740 19376 7636 65.04% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/buzzer/main.go 17592 25236 7644 43.45% 5972 6020 48 0.80% tinygo build -size short -o ./build/test.hex -target=pico ./examples/si5351/main.go 10160 17812 7652 75.31% 7128 7176 48 0.67% tinygo build -size short -o ./build/test.elf -target=wioterminal ./examples/axp192/m5stack-core2-blinky/ 7280 14936 7656 105.16% 3308 3356 48 1.45% tinygo build -size short -o ./build/test.hex -target=nucleo-f103rb ./examples/shiftregister/main.go 7988 15672 7684 96.19% 7128 7176 48 0.67% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/shifter/main.go 9416 17104 7688 81.65% 5128 5176 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017-multiple/main.go 11816 19516 7700 65.17% 5152 5200 48 0.93% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bmp388/main.go 8984 16688 7704 85.75% 5120 5168 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017/main.go 12796 20500 7704 60.21% 6880 6928 48 0.70% tinygo build -size short -o ./build/test.hex -target=pico ./examples/irremote/main.go 13304 21012 7708 57.94% 5896 5944 48 0.81% tinygo build -size short -o ./build/test.hex -target=pico ./examples/tmc5160/main.go 10472 18196 7724 73.76% 5120 5168 48 0.94% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis3dh/main.go 9448 17172 7724 81.75% 5104 5152 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ds18b20/main.go 12004 19728 7724 64.35% 4900 4948 48 0.98% tinygo build -size short -o ./build/test.uf2 -target=nicenano ./examples/sharpmem/main.go 12176 19932 7756 63.70% 5120 5168 48 0.94% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina219/main.go 13004 20768 7764 59.70% 5892 5940 48 0.81% tinygo build -size short -o ./build/test.hex -target=xiao-rp2040 ./examples/ssd1306/ 13092 20856 7764 59.30% 5892 5940 48 0.81% tinygo build -size short -o ./build/test.hex -target=thumby ./examples/ssd1306/ 10424 18188 7764 74.48% 5888 5936 48 0.82% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/xpt2046/main.go 13056 20820 7764 59.47% 5936 5984 48 0.81% tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/sh1106/macropad_spi 12312 20080 7768 63.09% 5952 6000 48 0.81% tinygo build -size short -o ./build/test.hex -target=pico ./examples/touch/capacitive 13756 21528 7772 56.50% 6408 6456 48 0.75% tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/waveshare-epd/epd2in9v2/main.go 9928 17712 7784 78.40% 6372 6420 48 0.75% tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/encoders/quadrature-interrupt 27644 35452 7808 28.24% 19024 19072 48 0.25% tinygo build -size short -o ./build/test.hex -target=pico ./examples/waveshare-epd/epd2in66b/main.go 9828 17640 7812 79.49% 5108 5156 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/itsybitsy-m0/main.go 13452 21276 7824 58.16% 5964 6012 48 0.80% tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/uc8151/main.go 10136 18048 7912 78.06% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/tm1637/main.go 11224 19144 7920 70.56% 5216 5264 48 0.92% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/scroll 11144 19068 7924 71.11% 5224 5272 48 0.92% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/basic 8764 16692 7928 90.46% 5088 5136 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adxl345/main.go 7764 15704 7940 102.27% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ttp229/main.go 9440 17388 7948 84.19% 5088 5136 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp3008/main.go 8420 16372 7952 94.44% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/hcsr04/main.go 8732 16684 7952 91.07% 5088 5136 48 0.94% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina260/main.go 10020 17996 7976 79.60% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mag3110/main.go 7464 15440 7976 106.86% 5088 5136 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mma8653/main.go 7368 15344 7976 108.25% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mpu6050/main.go 10376 18360 7984 76.95% 5088 5136 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/hd44780i2c/main.go 8008 15996 7988 99.75% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bh1750/main.go 7984 15976 7992 100.10% 5088 5136 48 0.94% tinygo build -size short -o ./build/test.uf2 -target=circuitplay-express ./examples/makeybutton/main.go 9120 17116 7996 87.68% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/speed/main.go 7096 15096 8000 112.74% 5120 5168 48 0.94% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/ws2812 12268 20268 8000 65.21% 5120 5168 48 0.94% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/veml6070/main.go 8924 16932 8008 89.74% 5088 5136 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/main.go 8716 16724 8008 91.88% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/speed/main.go 11248 19260 8012 71.23% 5104 5152 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/max72xx/main.go 12312 20332 8020 65.14% 5128 5176 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/lsm6ds3/main.go 6796 14820 8024 118.07% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/simple/main.go 6772 14796 8024 118.49% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/simple/main.go 7368 15420 8052 109.28% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/blinkm/main.go 7176 15232 8056 112.26% 5080 5128 48 0.94% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/clkout/ 6488 14636 8148 125.59% 2260 2308 48 2.12% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7789/main.go 6808 14988 8180 120.15% 2260 2308 48 2.12% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7735/main.go 6401776 7164715 762939 0.38% 1049404 1053683 4279 0.01% |
|
much better; the bulk of the above badness was trivially avoidable Size difference with the dev branch: Binary size differenceflash ram before after diff before after diff 23892 23924 32 0.13% 5952 5952 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-rp2350 ./examples/bno08x/i2c/main.go 6244 6420 176 2.82% 3268 3268 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setbuffer/main.go 4628 4804 176 3.80% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setpixel/main.go 26188 26376 188 0.72% 2304 2304 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/lsm303agr/main.go 4400 4900 500 11.36% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/easystepper/main.go 6356 6868 512 8.06% 2300 2300 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13/main.go 7068 7584 516 7.30% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/gc9a01/main.go 5896 6412 516 8.75% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1331/main.go 6248 6764 516 8.26% 2300 2300 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd4in2/main.go 5528 6052 524 9.48% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/customchar/main.go 5568 6092 524 9.41% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/text/main.go 7356 7884 528 7.18% 2296 2296 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/at24cx/main.go 15980 16508 528 3.30% 2340 2340 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hub75/main.go 9312 9848 536 5.76% 5232 5232 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-l432kc ./examples/aht20/main.go 5944 6516 572 9.62% 2292 2292 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13x/main.go 9416 10052 636 6.75% 5128 5128 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017-multiple/main.go 13096 13736 640 4.89% 5948 5948 0 0.00% tinygo build -size short -o ./build/test.hex -target=qtpy-rp2040 ./examples/seesaw/rotary-encoder 13388 14028 640 4.78% 5916 5916 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/qmi8658c/main.go 12796 13436 640 5.00% 6880 6880 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/irremote/main.go 14020 14660 640 4.56% 5956 5956 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/ens160/main.go 11720 12368 648 5.53% 5968 5968 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/scd4x/main.go 7032 7684 652 9.27% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=hifive1b ./examples/ssd1351/main.go 8984 9644 660 7.35% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017/main.go 11792 12456 664 5.63% 5940 5940 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/seesaw/soil-sensor 17792 18460 668 3.75% 7568 7568 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/as560x/main.go 13304 13980 676 5.08% 5896 5896 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/tmc5160/main.go 13680 14360 680 4.97% 5964 5964 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/pca9685/main.go 15264 15944 680 4.45% 6012 6012 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/sgp30 11816 12504 688 5.82% 5152 5152 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bmp388/main.go 13140 13828 688 5.24% 4924 4924 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/sx126x/lora_rxtx/ 11544 12232 688 5.96% 5908 5908 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu6886/main.go 11068 11756 688 6.22% 5900 5900 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu9150/main.go 17592 18280 688 3.91% 5972 5972 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/si5351/main.go 12524 13224 700 5.59% 5900 5900 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8591/ 10424 11124 700 6.72% 5888 5888 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/xpt2046/main.go 13056 13756 700 5.36% 5936 5936 0 0.00% tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/sh1106/macropad_spi 13004 13708 704 5.41% 5892 5892 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao-rp2040 ./examples/ssd1306/ 13092 13796 704 5.38% 5892 5892 0 0.00% tinygo build -size short -o ./build/test.hex -target=thumby ./examples/ssd1306/ 12312 13016 704 5.72% 5952 5952 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/touch/capacitive 9448 10152 704 7.45% 5104 5104 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ds18b20/main.go 10472 11180 708 6.76% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis3dh/main.go 18308 19020 712 3.89% 6784 6784 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/adafruit4650 13756 14468 712 5.18% 6408 6408 0 0.00% tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/waveshare-epd/epd2in9v2/main.go 9928 10644 716 7.21% 6372 6372 0 0.00% tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/encoders/quadrature-interrupt 7720 8448 728 9.43% 3336 3336 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/sram/main.go 71612 72344 732 1.02% 3640 3640 0 0.00% tinygo build -size short -o ./build/test.hex -target=pinetime ./examples/bma42x/main.go 12176 12912 736 6.04% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina219/main.go 27644 28388 744 2.69% 19024 19024 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/waveshare-epd/epd2in66b/main.go 13452 14204 752 5.59% 5964 5964 0 0.00% tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/uc8151/main.go 9828 10584 756 7.69% 5108 5108 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/itsybitsy-m0/main.go 32068 32824 756 2.36% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bme280/main.go 29080 29844 764 2.63% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/alarms/main.go 9640 10408 768 7.97% 4880 4880 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-bluefruit ./examples/tone 11372 12144 772 6.79% 6928 6928 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/apds9960/proximity/main.go 14248 15020 772 5.42% 6928 6928 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/hts221/main.go 13632 14404 772 5.66% 6928 6928 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/lps22hb/main.go 24636 25408 772 3.13% 14076 14076 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840-sense ./examples/waveshare-epd/epd1in54/main.go 12344 13120 776 6.29% 8712 8712 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao-ble ./examples/ssd1306/ 33144 33924 780 2.35% 7408 7408 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/ssd1289/main.go 27572 28368 796 2.89% 3808 3808 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/microbitmatrix/main.go 27492 28296 804 2.92% 5852 5852 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit-v2 ./examples/microbitmatrix/main.go 22680 23484 804 3.54% 7268 7268 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/w5500/main.go 5510 6316 806 14.63% 8918 9006 88 0.99% tinygo build -size short -o ./build/test.bin -target=m5stamp-c3 ./examples/ws2812 8816 9660 844 9.57% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/fourwire/main.go 27860 28712 852 3.06% 7168 7168 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/lsm303dlhc/main.go 16392 17244 852 5.20% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/microphone/main.go 7280 8132 852 11.70% 3308 3308 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-f103rb ./examples/shiftregister/main.go 29436 30292 856 2.91% 38424 38424 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/pyportal_boing 21604 22464 860 3.98% 3532 3532 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/time/main.go 8764 9628 864 9.86% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adxl345/main.go 27664 28532 868 3.14% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp180/main.go 15772 16640 868 5.50% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go 16784 17660 876 5.22% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/thermistor/main.go 7764 8640 876 11.28% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ttp229/main.go 11144 12024 880 7.90% 5224 5224 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/basic 9440 10320 880 9.32% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp3008/main.go 14328 15208 880 6.14% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go 10188 11072 884 8.68% 7256 7256 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/scroll 8420 9308 888 10.55% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/hcsr04/main.go 10156 11044 888 8.74% 7264 7264 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/basic 11224 12112 888 7.91% 5216 5216 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/scroll 12348 13248 900 7.29% 7324 7324 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go 8732 9632 900 10.31% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina260/main.go 42956 43864 908 2.11% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/basic/main.go 10020 10928 908 9.06% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mag3110/main.go 7464 8376 912 12.22% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mma8653/main.go 7368 8280 912 12.38% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mpu6050/main.go 10136 11048 912 9.00% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/tm1637/main.go 13280 14200 920 6.93% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis2mdl/main.go 7984 8904 920 11.52% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=circuitplay-express ./examples/makeybutton/main.go 8008 8932 924 11.54% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bh1750/main.go 10376 11304 928 8.94% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/hd44780i2c/main.go 10160 11088 928 9.13% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.elf -target=wioterminal ./examples/axp192/m5stack-core2-blinky/ 7096 8028 932 13.13% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/ws2812 12268 13204 936 7.63% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/veml6070/main.go 9120 10060 940 10.31% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/speed/main.go 13636 14580 944 6.92% 7136 7136 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/amg88xx 8924 9868 944 10.58% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/main.go 11740 12684 944 8.04% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/buzzer/main.go 8716 9660 944 10.83% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/speed/main.go 11248 12200 952 8.46% 5104 5104 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/max72xx/main.go 6796 7756 960 14.13% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/simple/main.go 6772 7732 960 14.18% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/simple/main.go 12312 13276 964 7.83% 5128 5128 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/lsm6ds3/main.go 43896 44868 972 2.21% 7736 7736 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/tmc2209/main.go 7988 8964 976 12.22% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/shifter/main.go 7368 8356 988 13.41% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/blinkm/main.go 7176 8168 992 13.82% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/clkout/ 68336 69348 1012 1.48% 6852 6852 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/uart/main.go 12004 13044 1040 8.66% 4900 4900 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=nicenano ./examples/sharpmem/main.go 67636 68680 1044 1.54% 6704 6704 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/i2c/main.go 42360 43404 1044 2.46% 8964 8964 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/sx127x/lora_rxtx/ 37404 38456 1052 2.81% 6604 6604 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8523/ 6488 7572 1084 16.71% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7789/main.go 6808 7924 1116 16.39% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7735/main.go 66832 68004 1172 1.75% 9368 9368 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/flash/console/qspi 62520 63700 1180 1.89% 6332 6332 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/max6675/main.go 62096 63324 1228 1.98% 8576 8576 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/i2csoft/adt7410/ 122808 124052 1244 1.01% 8112 8112 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/lora/lorawan/atcmd/ 62780 64064 1284 2.05% 6296 6296 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/is31fl3731/main.go 103740 105040 1300 1.25% 10408 10408 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-m4-airlift -stack-size 8kb ./examples/net/socket/ 65724 67032 1308 1.99% 6544 6544 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmi160/main.go 70472 71812 1340 1.90% 7328 7328 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/flash/console/spi 57420 58760 1340 2.33% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht3x/main.go 57420 58760 1340 2.33% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/shtc3/main.go 263400 264748 1348 0.51% 47108 47108 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/slideshow 57412 58760 1348 2.35% 3680 3680 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht4x/main.go 61840 63196 1356 2.19% 6528 6528 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adt7410/main.go 64396 65760 1364 2.12% 6568 6568 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp280/main.go 3113 4493 1380 44.33% 560 581 21 3.75% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/servo 1997 3377 1380 69.10% 600 621 21 3.50% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/ws2812 73864 75252 1388 1.88% 11108 11108 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/sdcard/console/ 68440 69836 1396 2.04% 7404 7404 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mcp9808/main.go 1488 2889 1401 94.15% 182 203 21 11.54% tinygo build -size short -o ./build/test.hex -target=digispark ./examples/ws2812 117132 118560 1428 1.22% 13704 13704 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webclient/ 65388 66848 1460 2.23% 6600 6600 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ndir/main_ndir.go 62036 63504 1468 2.37% 3768 3768 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ndir/main_ndir.go 68744 70236 1492 2.17% 7436 7436 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/ndir/main_ndir.go 120160 121676 1516 1.26% 12516 12516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2350 -stack-size 8kb ./examples/net/ntpclient/ 71424 72980 1556 2.18% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/alarm/ 76572 78176 1604 2.09% 7804 7804 0 0.00% tinygo build -size short -o ./build/test.hex -target=p1am-100 ./examples/p1am/main.go 77060 78664 1604 2.08% 6680 6680 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/dht/main.go 88024 89636 1612 1.83% 7756 7756 0 0.00% tinygo build -size short -o ./build/test.hex -target=challenger-rp2040 ./examples/net/ntpclient/ 71852 73472 1620 2.25% 6584 6584 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp2515/main.go 70860 72480 1620 2.29% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/time/ 71256 72900 1644 2.31% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/timer/ 120616 122532 1916 1.59% 8428 8428 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 -stack-size 8kb ./examples/net/tcpclient/ 167088 169052 1964 1.18% 10432 10432 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-mkrwifi1010 -stack-size 8kb ./examples/net/tlsclient/ 174808 176836 2028 1.16% 14516 14516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2040 -stack-size 8kb ./examples/net/tlsclient/ 156544 158748 2204 1.41% 9384 9384 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/mqttclient/natiu/ 346316 348928 2612 0.75% 22440 22424 -16 -0.07% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/mqttclient/paho/ 353292 356128 2836 0.80% 17376 17376 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal -stack-size 8kb ./examples/net/http-get/ 345076 348416 3340 0.97% 22468 22468 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webserver/ 315056 318484 3428 1.09% 16664 16648 -16 -0.10% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/websocket/dial/ 396524 400368 3844 0.97% 19420 19404 -16 -0.08% tinygo build -size short -o ./build/test.hex -target=matrixportal-m4 -stack-size 8kb ./examples/net/webstatic/ 6401776 6558699 156923 0.07% 1049404 1049507 103 0.00% |
|
about 2/3 of the increase is due to the index/bounds panic message. Maybe some of this is worth sticking behind flags for those who don't care about extra info (or even don't want panic recovery at all?) |
|
The improved binary sizes are still oof material. I remember we used to debate whether 5% increases were worth these kind of improvements back in the day 👴 Maybe worth opening a discussion to chat about how to approach the increasing binary problem. There's different strategies I imagine we could take to ensure tinygo stays tiny. |
|
Size difference with the dev branch: Binary size differenceflash ram before after diff before after diff 23892 23812 -80 -0.33% 5952 5952 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-rp2350 ./examples/bno08x/i2c/main.go 6244 6420 176 2.82% 3268 3268 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setbuffer/main.go 4628 4804 176 3.80% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setpixel/main.go 26188 26376 188 0.72% 2304 2304 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/lsm303agr/main.go 12176 12460 284 2.33% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina219/main.go 10472 10760 288 2.75% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis3dh/main.go 8984 9280 296 3.29% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017/main.go 9828 10128 300 3.05% 5108 5108 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/itsybitsy-m0/main.go 27860 28260 400 1.44% 7168 7168 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/lsm303dlhc/main.go 8764 9168 404 4.61% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adxl345/main.go 27664 28072 408 1.47% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp180/main.go 15772 16184 412 2.61% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go 7764 8184 420 5.41% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ttp229/main.go 14328 14752 424 2.96% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go 8420 8852 432 5.13% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/hcsr04/main.go 16784 17216 432 2.57% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/thermistor/main.go 10020 10464 444 4.43% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mag3110/main.go 7464 7916 452 6.06% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mma8653/main.go 7368 7820 452 6.13% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mpu6050/main.go 13280 13740 460 3.46% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis2mdl/main.go 8008 8472 464 5.79% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bh1750/main.go 12268 12748 480 3.91% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/veml6070/main.go 8716 9200 484 5.55% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/speed/main.go 9120 9604 484 5.31% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/speed/main.go 8924 9412 488 5.47% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/main.go 11740 12228 488 4.16% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/buzzer/main.go 6796 7300 504 7.42% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/simple/main.go 6772 7276 504 7.44% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/simple/main.go 11248 11752 504 4.48% 5104 5104 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/max72xx/main.go 5528 6036 508 9.19% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/customchar/main.go 5568 6076 508 9.12% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/text/main.go 12312 12820 508 4.13% 5128 5128 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/lsm6ds3/main.go 6356 6868 512 8.06% 2300 2300 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13/main.go 4400 4916 516 11.73% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/easystepper/main.go 7068 7584 516 7.30% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/gc9a01/main.go 5896 6412 516 8.75% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1331/main.go 6248 6764 516 8.26% 2300 2300 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd4in2/main.go 11792 12312 520 4.41% 5940 5940 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/seesaw/soil-sensor 15980 16504 524 3.28% 2340 2340 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hub75/main.go 7356 7888 532 7.23% 2296 2296 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/at24cx/main.go 7368 7900 532 7.22% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/blinkm/main.go 10156 10936 780 7.68% 7264 7264 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/basic 10188 10968 780 7.66% 7256 7256 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/scroll 11144 11932 788 7.07% 5224 5224 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/basic 12348 13136 788 6.38% 7324 7324 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go 9440 10232 792 8.39% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp3008/main.go 21604 22400 796 3.68% 3532 3532 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/time/main.go 11224 12028 804 7.16% 5216 5216 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/scroll 8732 9536 804 9.21% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina260/main.go 5510 6316 806 14.63% 8918 9006 88 0.99% tinygo build -size short -o ./build/test.bin -target=m5stamp-c3 ./examples/ws2812 6488 7300 812 12.52% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7789/main.go 7984 8796 812 10.17% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=circuitplay-express ./examples/makeybutton/main.go 10136 10956 820 8.09% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/tm1637/main.go 10376 11200 824 7.94% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/hd44780i2c/main.go 10160 10988 828 8.15% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.elf -target=wioterminal ./examples/axp192/m5stack-core2-blinky/ 13636 14476 840 6.16% 7136 7136 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/amg88xx 7096 7936 840 11.84% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/ws2812 12004 12844 840 7.00% 4900 4900 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=nicenano ./examples/sharpmem/main.go 42956 43800 844 1.96% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/basic/main.go 7988 8848 860 10.77% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/shifter/main.go 37404 38276 872 2.33% 6604 6604 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8523/ 42360 43236 876 2.07% 8964 8964 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/sx127x/lora_rxtx/ 68336 69244 908 1.33% 6852 6852 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/uart/main.go 67636 68552 916 1.35% 6704 6704 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/i2c/main.go 263400 264328 928 0.35% 47108 47096 -12 -0.03% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/slideshow 43896 44860 964 2.20% 7736 7736 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/tmc2209/main.go 62096 63132 1036 1.67% 8576 8576 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/i2csoft/adt7410/ 122808 123900 1092 0.89% 8112 8112 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/lora/lorawan/atcmd/ 66832 67988 1156 1.73% 9368 9368 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/flash/console/qspi 61840 63036 1196 1.93% 6528 6528 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adt7410/main.go 62520 63716 1196 1.91% 6332 6332 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/max6675/main.go 64396 65600 1204 1.87% 6568 6568 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp280/main.go 57420 58624 1204 2.10% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht3x/main.go 57412 58616 1204 2.10% 3680 3680 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht4x/main.go 57420 58624 1204 2.10% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/shtc3/main.go 68440 69644 1204 1.76% 7404 7404 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mcp9808/main.go 65724 66936 1212 1.84% 6544 6544 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmi160/main.go 103740 104968 1228 1.18% 10408 10408 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-m4-airlift -stack-size 8kb ./examples/net/socket/ 70472 71716 1244 1.77% 7328 7328 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/flash/console/spi 62780 64088 1308 2.08% 6296 6296 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/is31fl3731/main.go 65388 66728 1340 2.05% 6600 6600 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ndir/main_ndir.go 73864 75212 1348 1.82% 11108 11108 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/sdcard/console/ 62036 63384 1348 2.17% 3768 3768 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ndir/main_ndir.go 71424 72788 1364 1.91% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/alarm/ 117132 118496 1364 1.16% 13704 13704 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webclient/ 3113 4493 1380 44.33% 560 581 21 3.75% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/servo 1997 3377 1380 69.10% 600 621 21 3.50% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/ws2812 68744 70124 1380 2.01% 7436 7436 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/ndir/main_ndir.go 71852 73248 1396 1.94% 6584 6584 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp2515/main.go 1488 2889 1401 94.15% 182 203 21 11.54% tinygo build -size short -o ./build/test.hex -target=digispark ./examples/ws2812 88024 89428 1404 1.60% 7756 7756 0 0.00% tinygo build -size short -o ./build/test.hex -target=challenger-rp2040 ./examples/net/ntpclient/ 120160 121572 1412 1.18% 12516 12516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2350 -stack-size 8kb ./examples/net/ntpclient/ 77060 78488 1428 1.85% 6680 6680 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/dht/main.go 76572 78016 1444 1.89% 7804 7804 0 0.00% tinygo build -size short -o ./build/test.hex -target=p1am-100 ./examples/p1am/main.go 70860 72312 1452 2.05% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/time/ 71256 72732 1476 2.07% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/timer/ 120616 122316 1700 1.41% 8428 8428 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 -stack-size 8kb ./examples/net/tcpclient/ 167088 168852 1764 1.06% 10432 10432 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-mkrwifi1010 -stack-size 8kb ./examples/net/tlsclient/ 156544 158340 1796 1.15% 9384 9384 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/mqttclient/natiu/ 174808 176636 1828 1.05% 14516 14516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2040 -stack-size 8kb ./examples/net/tlsclient/ 346316 348592 2276 0.66% 22440 22424 -16 -0.07% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/mqttclient/paho/ 353292 355888 2596 0.73% 17376 17376 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal -stack-size 8kb ./examples/net/http-get/ 345076 348016 2940 0.85% 22468 22468 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webserver/ 315056 318244 3188 1.01% 16664 16648 -16 -0.10% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/websocket/dial/ 396524 399864 3340 0.84% 19420 19404 -16 -0.08% tinygo build -size short -o ./build/test.hex -target=matrixportal-m4 -stack-size 8kb ./examples/net/webstatic/ 6401776 6532051 130275 0.05% 1049404 1049495 91 0.00% |
|
So, I think I just need to drop out the sort of "optional" features out to recover space savings, namely the better bounds printing and the panic chaining. They increase the size and don't seem to be worth it, at least without a flag to undo it. |
|
Better still: Size difference with the dev branch: Binary size differenceflash ram before after diff before after diff 3113 3113 0 0.00% 560 560 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/servo 1997 1997 0 0.00% 600 600 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/ws2812 1488 1488 0 0.00% 182 182 0 0.00% tinygo build -size short -o ./build/test.hex -target=digispark ./examples/ws2812 71612 71656 44 0.06% 3640 3640 0 0.00% tinygo build -size short -o ./build/test.hex -target=pinetime ./examples/bma42x/main.go 13636 13748 112 0.82% 7136 7136 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/amg88xx 10156 10268 112 1.10% 7264 7264 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/basic 29436 29548 112 0.38% 38424 38424 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/pyportal_boing 10188 10300 112 1.10% 7256 7256 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/scroll 7988 8100 112 1.40% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/shifter/main.go 8816 8928 112 1.27% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/fourwire/main.go 12348 12460 112 0.91% 7324 7324 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go 7280 7392 112 1.54% 3308 3308 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-f103rb ./examples/shiftregister/main.go 10160 10272 112 1.10% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.elf -target=wioterminal ./examples/axp192/m5stack-core2-blinky/ 8764 8880 116 1.32% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adxl345/main.go 8924 9040 116 1.30% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/main.go 8008 8124 116 1.45% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bh1750/main.go 7368 7484 116 1.57% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/blinkm/main.go 27664 27780 116 0.42% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp180/main.go 8420 8536 116 1.38% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/hcsr04/main.go 10376 10492 116 1.12% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/hd44780i2c/main.go 11144 11260 116 1.04% 5224 5224 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/basic 11224 11340 116 1.03% 5216 5216 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/scroll 10020 10136 116 1.16% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mag3110/main.go 9440 9556 116 1.23% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp3008/main.go 7464 7580 116 1.55% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mma8653/main.go 7368 7484 116 1.57% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mpu6050/main.go 6808 6924 116 1.70% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7735/main.go 6488 6604 116 1.79% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7789/main.go 16784 16900 116 0.69% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/thermistor/main.go 10136 10252 116 1.14% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/tm1637/main.go 15772 15888 116 0.74% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go 14328 14444 116 0.81% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go 7096 7212 116 1.63% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/ws2812 16392 16508 116 0.71% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/microphone/main.go 11740 11856 116 0.99% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/buzzer/main.go 12268 12384 116 0.95% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/veml6070/main.go 6796 6912 116 1.71% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/simple/main.go 8716 8832 116 1.33% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/speed/main.go 6772 6888 116 1.71% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/simple/main.go 13280 13396 116 0.87% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis2mdl/main.go 7176 7292 116 1.62% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/clkout/ 8984 9140 156 1.74% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017/main.go 9416 9572 156 1.66% 5128 5128 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017-multiple/main.go 13680 13836 156 1.14% 5964 5964 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/pca9685/main.go 15264 15420 156 1.02% 6012 6012 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/sgp30 32068 32224 156 0.49% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bme280/main.go 9312 9468 156 1.68% 5232 5232 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-l432kc ./examples/aht20/main.go 13452 13608 156 1.16% 5964 5964 0 0.00% tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/uc8151/main.go 17592 17748 156 0.89% 5972 5972 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/si5351/main.go 263400 263580 180 0.07% 47108 47108 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/slideshow 27492 27672 180 0.65% 5852 5852 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit-v2 ./examples/microbitmatrix/main.go 33144 33324 180 0.54% 7408 7408 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/ssd1289/main.go 27572 27760 188 0.68% 3808 3808 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/microbitmatrix/main.go 11372 11568 196 1.72% 6928 6928 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/apds9960/proximity/main.go 9640 9836 196 2.03% 4880 4880 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-bluefruit ./examples/tone 24636 24832 196 0.80% 14076 14076 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840-sense ./examples/waveshare-epd/epd1in54/main.go 14248 14448 200 1.40% 6928 6928 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/hts221/main.go 13632 13832 200 1.47% 6928 6928 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/lps22hb/main.go 12344 12544 200 1.62% 8712 8712 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao-ble ./examples/ssd1306/ 42360 42588 228 0.54% 8964 8964 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/sx127x/lora_rxtx/ 21604 21848 244 1.13% 3532 3532 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/time/main.go 29080 29348 268 0.92% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/alarms/main.go 42956 43224 268 0.62% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/basic/main.go 37404 37672 268 0.72% 6604 6604 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8523/ 67636 67920 284 0.42% 6704 6704 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/i2c/main.go 68336 68620 284 0.42% 6852 6852 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/uart/main.go 66832 67148 316 0.47% 9368 9368 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/flash/console/qspi 43896 44216 320 0.73% 7736 7736 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/tmc2209/main.go 73864 74188 324 0.44% 11108 11108 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/sdcard/console/ 5510 5850 340 6.17% 8918 8986 68 0.76% tinygo build -size short -o ./build/test.bin -target=m5stamp-c3 ./examples/ws2812 122808 123164 356 0.29% 8112 8112 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/lora/lorawan/atcmd/ 70472 70836 364 0.52% 7328 7328 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/flash/console/spi 57420 57792 372 0.65% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht3x/main.go 57420 57792 372 0.65% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/shtc3/main.go 62096 62468 372 0.60% 8576 8576 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/i2csoft/adt7410/ 57412 57792 380 0.66% 3680 3680 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht4x/main.go 65724 66112 388 0.59% 6544 6544 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmi160/main.go 62036 62424 388 0.63% 3768 3768 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ndir/main_ndir.go 65388 65776 388 0.59% 6600 6600 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ndir/main_ndir.go 61840 62236 396 0.64% 6528 6528 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adt7410/main.go 64396 64792 396 0.61% 6568 6568 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp280/main.go 68744 69140 396 0.58% 7436 7436 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/ndir/main_ndir.go 68440 68836 396 0.58% 7404 7404 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mcp9808/main.go 12004 12408 404 3.37% 4900 4900 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=nicenano ./examples/sharpmem/main.go 71852 72272 420 0.58% 6584 6584 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp2515/main.go 62780 63208 428 0.68% 6296 6296 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/is31fl3731/main.go 62520 62948 428 0.68% 6332 6332 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/max6675/main.go 76572 77008 436 0.57% 7804 7804 0 0.00% tinygo build -size short -o ./build/test.hex -target=p1am-100 ./examples/p1am/main.go 353292 353744 452 0.13% 17376 17376 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal -stack-size 8kb ./examples/net/http-get/ 103740 104208 468 0.45% 10408 10408 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-m4-airlift -stack-size 8kb ./examples/net/socket/ 88024 88500 476 0.54% 7756 7756 0 0.00% tinygo build -size short -o ./build/test.hex -target=challenger-rp2040 ./examples/net/ntpclient/ 315056 315532 476 0.15% 16664 16648 -16 -0.10% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/websocket/dial/ 77060 77544 484 0.63% 6680 6680 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/dht/main.go 117132 117616 484 0.41% 13704 13704 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webclient/ 71424 71924 500 0.70% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/alarm/ 70860 71360 500 0.71% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/time/ 71256 71756 500 0.70% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/timer/ 120616 121116 500 0.41% 8428 8428 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 -stack-size 8kb ./examples/net/tcpclient/ 167088 167588 500 0.30% 10432 10432 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-mkrwifi1010 -stack-size 8kb ./examples/net/tlsclient/ 174808 175332 524 0.30% 14516 14516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2040 -stack-size 8kb ./examples/net/tlsclient/ 120160 120732 572 0.48% 12516 12516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2350 -stack-size 8kb ./examples/net/ntpclient/ 346316 346936 620 0.18% 22440 22424 -16 -0.07% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/mqttclient/paho/ 156544 157220 676 0.43% 9384 9384 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/mqttclient/natiu/ 345076 345848 772 0.22% 22468 22468 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webserver/ 396524 397584 1060 0.27% 19420 19404 -16 -0.08% tinygo build -size short -o ./build/test.hex -target=matrixportal-m4 -stack-size 8kb ./examples/net/webstatic/ 6401776 6436196 34420 0.01% 1049404 1049424 20 0.00% |
|
I don't think I have any ideas for how to make this smaller. The increase here is just the cost of the new code paths to make panic/recover work... |
Emit fault checkpoints around compiler-generated runtime assertions so runtimePanicAt can unwind through the existing defer/recover machinery instead of aborting. This lets panics from bounds checks, type checks, and other compiler-inserted runtime checks be recovered by deferred functions. Mark functions that call recover as noinline. Inlining such a function into a deferred closure can make recover observe the wrong call context and report success when it should return nil. Addresses tinygo-org/tinygo issues 2759 and 3510.
Change hashmap set operations and channel send/close from createRuntimeCall to createRuntimeInvoke. This places a setjmp checkpoint before each call, allowing runtimePanicAt to safely longjmp when these operations panic.
Modify the Unix signal handler to redirect execution to a Go sigpanic function instead of printing an error and re-raising the signal. The C signal handler modifies the ucontext to make the faulting instruction appear to have called tinygo_sigpanic, which then calls runtimePanic with the appropriate message. Supported on all architectures TinyGo targets on Linux and Darwin: x86_64, i386, aarch64, ARM, and MIPS. Also registers SIGFPE, which was previously not handled at all.
Register a vectored exception handler at startup so Windows hardware exceptions can be translated into Go panics. Access violations become nil pointer panics, and integer divide-by-zero exceptions become divide by zero panics, allowing defer/recover to handle them like ordinary runtime panics.
Add newly passing packages to the appropriate native and Windows standard-library test lists, and refresh comments for packages that remain disabled.
|
I got it a bit better again... I think this actually acceptable? Size difference with the dev branch: Binary size differenceflash ram before after diff before after diff 345076 344800 -276 -0.08% 22468 22468 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webserver/ 263400 263136 -264 -0.10% 47108 47096 -12 -0.03% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/slideshow 353292 353096 -196 -0.06% 17376 17376 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal -stack-size 8kb ./examples/net/http-get/ 396524 396344 -180 -0.05% 19420 19404 -16 -0.08% tinygo build -size short -o ./build/test.hex -target=matrixportal-m4 -stack-size 8kb ./examples/net/webstatic/ 71612 71440 -172 -0.24% 3640 3640 0 0.00% tinygo build -size short -o ./build/test.hex -target=pinetime ./examples/bma42x/main.go 346316 346176 -140 -0.04% 22440 22424 -16 -0.07% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/mqttclient/paho/ 23892 23856 -36 -0.15% 5952 5952 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-rp2350 ./examples/bno08x/i2c/main.go 3113 3113 0 0.00% 560 560 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/servo 1997 1997 0 0.00% 600 600 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/ws2812 1488 1488 0 0.00% 182 182 0 0.00% tinygo build -size short -o ./build/test.hex -target=digispark ./examples/ws2812 22680 22756 76 0.34% 7268 7268 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/w5500/main.go 29436 29536 100 0.34% 38424 38424 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/pyportal_boing 66832 66940 108 0.16% 9368 9368 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/flash/console/qspi 10020 10128 108 1.08% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mag3110/main.go 13636 13748 112 0.82% 7136 7136 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/amg88xx 10156 10268 112 1.10% 7264 7264 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/basic 10188 10300 112 1.10% 7256 7256 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/scroll 8816 8928 112 1.27% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/fourwire/main.go 12348 12460 112 0.91% 7324 7324 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go 7280 7392 112 1.54% 3308 3308 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-f103rb ./examples/shiftregister/main.go 10160 10272 112 1.10% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.elf -target=wioterminal ./examples/axp192/m5stack-core2-blinky/ 8764 8880 116 1.32% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adxl345/main.go 8924 9040 116 1.30% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/main.go 8008 8124 116 1.45% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bh1750/main.go 27664 27780 116 0.42% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp180/main.go 8420 8536 116 1.38% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/hcsr04/main.go 11144 11260 116 1.04% 5224 5224 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/basic 7464 7580 116 1.55% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mma8653/main.go 7368 7484 116 1.57% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mpu6050/main.go 7988 8104 116 1.45% 7128 7128 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/shifter/main.go 6808 6924 116 1.70% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7735/main.go 6488 6604 116 1.79% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7789/main.go 16784 16900 116 0.69% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/thermistor/main.go 10136 10252 116 1.14% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/tm1637/main.go 15772 15888 116 0.74% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go 14328 14444 116 0.81% 5088 5088 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go 7096 7212 116 1.63% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/ws2812 16392 16508 116 0.71% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/microphone/main.go 11740 11856 116 0.99% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/buzzer/main.go 12268 12384 116 0.95% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/veml6070/main.go 6796 6912 116 1.71% 5080 5080 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/simple/main.go 9312 9464 152 1.63% 5232 5232 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-l432kc ./examples/aht20/main.go 10424 10576 152 1.46% 5888 5888 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/xpt2046/main.go 12796 12948 152 1.19% 6880 6880 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/irremote/main.go 13756 13908 152 1.10% 6408 6408 0 0.00% tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/waveshare-epd/epd2in9v2/main.go 11544 11696 152 1.32% 5908 5908 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu6886/main.go 11068 11220 152 1.37% 5900 5900 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu9150/main.go 13056 13208 152 1.16% 5936 5936 0 0.00% tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/sh1106/macropad_spi 9928 10080 152 1.53% 6372 6372 0 0.00% tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/encoders/quadrature-interrupt 11372 11528 156 1.37% 6928 6928 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/apds9960/proximity/main.go 9640 9796 156 1.62% 4880 4880 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-bluefruit ./examples/tone 24636 24792 156 0.63% 14076 14076 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840-sense ./examples/waveshare-epd/epd1in54/main.go 13452 13608 156 1.16% 5964 5964 0 0.00% tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/uc8151/main.go 7356 7516 160 2.18% 2296 2296 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/at24cx/main.go 14248 14408 160 1.12% 6928 6928 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/hts221/main.go 13632 13792 160 1.17% 6928 6928 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/lps22hb/main.go 12344 12504 160 1.30% 8712 8712 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao-ble ./examples/ssd1306/ 13388 13548 160 1.20% 5916 5916 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/qmi8658c/main.go 13096 13260 164 1.25% 5948 5948 0 0.00% tinygo build -size short -o ./build/test.hex -target=qtpy-rp2040 ./examples/seesaw/rotary-encoder 32068 32232 164 0.51% 5120 5120 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bme280/main.go 13680 13848 168 1.23% 5964 5964 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/pca9685/main.go 17592 17760 168 0.95% 5972 5972 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/si5351/main.go 17792 17964 172 0.97% 7568 7568 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/as560x/main.go 13304 13476 172 1.29% 5896 5896 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/tmc5160/main.go 33144 33332 188 0.57% 7408 7408 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/ssd1289/main.go 29080 29276 196 0.67% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/alarms/main.go 27492 27688 196 0.71% 5852 5852 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit-v2 ./examples/microbitmatrix/main.go 27572 27776 204 0.74% 3808 3808 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/microbitmatrix/main.go 315056 315260 204 0.06% 16664 16648 -16 -0.10% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/websocket/dial/ 42956 43192 236 0.55% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/basic/main.go 37404 37640 236 0.63% 6604 6604 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8523/ 12004 12244 240 2.00% 4900 4900 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=nicenano ./examples/sharpmem/main.go 117132 117376 244 0.21% 13704 13704 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webclient/ 65388 65640 252 0.39% 6600 6600 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ndir/main_ndir.go 64396 64656 260 0.40% 6568 6568 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp280/main.go 62036 62296 260 0.42% 3768 3768 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ndir/main_ndir.go 70472 70740 268 0.38% 7328 7328 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/flash/console/spi 57420 57688 268 0.47% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht3x/main.go 57420 57688 268 0.47% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/shtc3/main.go 68440 68708 268 0.39% 7404 7404 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mcp9808/main.go 103740 104008 268 0.26% 10408 10408 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-m4-airlift -stack-size 8kb ./examples/net/socket/ 21604 21880 276 1.28% 3532 3532 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/time/main.go 57412 57688 276 0.48% 3680 3680 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht4x/main.go 68744 69020 276 0.40% 7436 7436 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/ndir/main_ndir.go 61840 62124 284 0.46% 6528 6528 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adt7410/main.go 62780 63064 284 0.45% 6296 6296 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/is31fl3731/main.go 65724 66016 292 0.44% 6544 6544 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmi160/main.go 120160 120460 300 0.25% 12516 12516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2350 -stack-size 8kb ./examples/net/ntpclient/ 43896 44200 304 0.69% 7736 7736 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/tmc2209/main.go 67636 67944 308 0.46% 6704 6704 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/i2c/main.go 68336 68644 308 0.45% 6852 6852 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/uart/main.go 62520 62828 308 0.49% 6332 6332 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/max6675/main.go 42360 42676 316 0.75% 8964 8964 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/sx127x/lora_rxtx/ 71852 72192 340 0.47% 6584 6584 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp2515/main.go 5510 5850 340 6.17% 8918 8986 68 0.76% tinygo build -size short -o ./build/test.bin -target=m5stamp-c3 ./examples/ws2812 156544 156884 340 0.22% 9384 9384 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/mqttclient/natiu/ 174808 175188 380 0.22% 14516 14516 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2040 -stack-size 8kb ./examples/net/tlsclient/ 167088 167476 388 0.23% 10432 10432 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-mkrwifi1010 -stack-size 8kb ./examples/net/tlsclient/ 120616 121020 404 0.33% 8428 8428 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 -stack-size 8kb ./examples/net/tcpclient/ 76572 77016 444 0.58% 7804 7804 0 0.00% tinygo build -size short -o ./build/test.hex -target=p1am-100 ./examples/p1am/main.go 88024 88468 444 0.50% 7756 7756 0 0.00% tinygo build -size short -o ./build/test.hex -target=challenger-rp2040 ./examples/net/ntpclient/ 71424 71900 476 0.67% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/alarm/ 77060 77560 500 0.65% 6680 6680 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/dht/main.go 71256 71796 540 0.76% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/timer/ 70860 71408 548 0.77% 6688 6688 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/time/ 6401776 6427200 25424 0.01% 1049404 1049412 8 0.00% |
I would agree, good work! Also, the main thing I personally care more about than anything else is RAM use, more than flash size. |
Fixes #3449
Fixes #3510
Fixes #2759
This sort of ballooned out of control a bit, but, in addition to fixing #3449, this now makes panic/recover fully supported in virtually all scenarios I can think of; if tinygo supports
synctest,encoding/jsonpasses all tests!Each commit has a better description, but describing things generally as they stand when I send the PR:
deferPtruses;they needed to be volatile otherwise longjmp clobbers it if it gets pulled into a registerfixed another way, storing the value into the frame. This was the main thing I had started fixing before I pushed this stack to trying to getjsonpassing 😄Include index/bounds info in panics; I can drop this out but it is pretty useful.increased space too muchPrint the full chain of panics when multiple happen.increased space too much by pulling in the alloc/GC codeThis then lets tinygo pass:
testing/fstestimagemimeregexp/syntaxtext/tabwriterAnd technically
encoding/json, but that requires an unrelated patch forsynctestas I mentioned before.