-
Notifications
You must be signed in to change notification settings - Fork 45
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
What's the 512b magic number? #62
Comments
Hello @osdevisnot ! Yes this indeed a magic number... but it's purpose is two-fold: 1. It just as small as it has to beFirst of all, start by having a look on the specs of an average device that could be used for IoT. For example to the ARDUINO MKR1000 WIFI. You will notice on the tech specs that it says:
Most of the MCUs in the market don't have a much bigger flash size, and don't forget that this size includes the bootloader, C/C++ libraries, a web server and your business logic in addition to the static files for the static UI you want to serve. This means that you should optimise things as much as physically possible. Ideally, your entire UI must fit in less than a KB! With this in mind, I started sketching out possible implementations of the library and aimed to fit it in the smallest power of 2 that I could reach. Interestingly enough, in around 400-500 bytes (Gzipped) I managed to squeeze all of the logic that could satisfy my demands. So the closest power of 2 was 512 bytes, giving me some slack for future features. 2. It is a contractAfter setting on that number, I decided to make this a contract, and lock this library to it. Even though it sounds controversial, this has quite some benefits:
However I am still willing to break this contract if there is a powerful feature that the community will desire 😄 |
This is mostly a question, but I was wondering what's so special about 512b number? Looking at some of the open/closed issues it seems you are attempting to fit an entire website (lib + css + app) in the MTU size (usually 1500 bytes). But I have no idea about iot devices, and I'm trying to figure implications of exceeding 1500 bytes.
Any pointers that can help me wrapping my head around the size limitations?
The text was updated successfully, but these errors were encountered: