Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: seedsigner on February 23, 2021, 08:32:13 PM
-
I am working on this project (https://github.com/SeedSigner/seedsigner). Without going into too much detail, the project integrates a camera and a GPIO-driven display and controls with a Raspberry Pi Zero to create a standalone cryptographic (read: Bitcoin) signing device. It allows users to input words, uses the camera to ingest animated QR codes, and then displays animated QR codes on the incorporated 240x240 pixel display. I currently have the project running on the standard headless Raspberry Pi OS, which makes for a painfully long boot process (~90 secs). I'm trying to get the boot process under 10 secs if possible. The main modules are written in Python, and I rely on several Python PIP modules. I am very new to looking at Tiny Core, so I thought I might just ask ya'll who are more familiar with Tiny Core whether it might be compatible with my project. Thanks so much for any perspective.
-
Yes, but your choice of Python will limit what can be gained. E.g. switching to TC may provide a 2x speedup in boot, 9x like what you wish for probably won't be possible with all those Python deps. A native compiled language like C or C++ would be best.
-
Curaga is right... I wrote a python app for an EV dash and found that boot times were not what I'd hoped, because of big python deps. However, I was able to reduce the time to boot and start the app to ~1/3rd my original time by using strace to create bespoke extension sets with only the functions I needed from each dep. Including one for all the relevant .pyc files, which are JIT-compiled python.
I haven't tried yet as I'm still making some improvements but you could use Nuitka to convert your python to C++ and compile it. Pyinstaller just packages the application, its dependencies and a python interpreter into a binary... basically just makes it portable but it'll be the same size. However, Nuitka actually algorithmically converts python to optimized C++. While it would still be better/smaller to start with C++, it could help-- you wouldn't need to load the python interpreter, or entire deps-- it'd be only what you need.
-
Sorry for the delayed response, really appreciate both of your perspectives. Am going to start playing around with tinycore and Nuitka, and see where I can get from there.
Thank you again!