-
-
Notifications
You must be signed in to change notification settings - Fork 753
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
freeHeap and vars #1625
Comments
It's just http://www.espruino.com/Internals#variable-storage If you get less than 1024 items then you need less bits for the address and it can use 12 bytes per var and not 16. It's not all good since Strings are less efficient to store though. |
Thanks. Have you planed any optimization? |
I was toying with it (I think I have a branch here) - but if you don't go with 16 or 12 you mess up the alignment, which is obviously bad news for ESP8266/32. Also non-flat Strings get more inefficient, so it's not all good news. |
let me try, there is |
https://github.com/espruino/Espruino/tree/experimental_compact_vars It may well hurt performance though |
Great - git clone and make flash - it works out of the box for a ESP8266_4MB build - many thanks!
Well ESP8266 is running with 160MHz so should not hurt too much ;-) Loaded some of my codes, worked without errors. Any things you want me to test? Maybe some excessive memory stuff including timestamps to compare with master branch builds? Just name it and I try to test it. |
I'm not sure - it's worth checking that classes and flat Strings work ok though. You did at one point have some method of running tests directly on the ESP8266? It might be worth trying a before and after and see if anything in particular breaks? |
Ok, lets do some one device testing Edit: Device Test Harness #1490 |
What large libs did you add - Why has this used heap space? |
SHA256, SHA512, AES
good question ;-) |
Try without AES. I added specific hacks to the linking phase to move the static tables for SHA1, SHA256 and SHA512 into RO so it goes to flash memory. I suspect the same think would need to happen for the AES code. What do you need AES for? |
The goal is to build Espruino with a tiny TLS solution, will create a new issue for this soon. Edit: Another goal: Add larger and/or color displays |
I'm not sure that's achievable ;-( |
It depends, like to check for with a minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites like this config.h |
I'd posted in another bug (or was it email from @MaBecker ?) mbedtls allocates a 16kB packet buffer. If you control both ends of the connection then you can make that buffer way lower - I think mbed says 2k is ok. Although obviously it may still be too tight. As @wilberforce says it'll probably require some hacks to get mbedtls arrays to go into flash rather than the usual ESP8266 thing of sticking them into RAM. However I'm not too happy about screwing with every bit of Espruino and library it uses to force stuff that's already |
As the major question is clearly answered, lets close this. |
added some large libs and had to reduce vars to make Espruino run.
'variables' : 1100
versus 'variables' : 1000
Why is freeHeap 5256 larger when only using 1000 vars compared to 1100 vars?
The text was updated successfully, but these errors were encountered: