Hacker News new | ask | show | jobs
by Karellen 1613 days ago
What's the max/typical read bandwidth from an SD card on a Pi? Even if the storage space is there, you might still get perceptible latency improvements with order-of-magnitude smaller binaries.
2 comments

On a Raspberry Pi 3 with a random SD card I found laying around:

    pi@octopi:~ $ sudo hdparm -tT /dev/mmcblk0
    /dev/mmcblk0:
     Timing cached reads:   1366 MB in  2.00 seconds = 683.30 MB/sec
     Timing buffered disk reads:  62 MB in  3.02 seconds =  20.53 MB/sec
So it's going to take a couple seconds to page this thing into memory. (The memory speed isn't great either.) It's not so slow that I'd bother to write application software in C just to make startup 5 seconds faster, though.

Meanwhile on a Threadripper 3970x with SSD (but virtualized):

    $ sudo hdparm -tT /dev/sda
    /dev/sda:
     Timing cached reads:   20200 MB in  2.00 seconds = 10109.10 MB/sec
     Timing buffered disk reads: 5296 MB in  3.00 seconds = 1763.28 MB/sec
If that’s an issue just cache the file in RAM. 500MB is still less than the system memory on a Pi (and as I’ve pointed elsewhere, the OP was reading the partition table not the application file sizes).
I guess, but this argument is basically just saying "RPi is basically just a normal computer now so why be conservative with anything?"
It is basically just a normal computer and I feel you’re optimising the wrong thing here too given we’ve already established the OP was wrong when they threw around what they believed to be the applications file sizes.
Indeed. If you are so concerned about memory usage that a 20MB app is so bothersome, why would you be running a 1+GB platform? The pi is the pi. No need to fret about optimizing down from 3% memory usage to 1%.
The Raspberry 3 Model A+ only has 512MB of RAM, so whilst the above might be 'technically correct', it doesn't seem like that would work in practice, at least on this one (the other types of Model 3 (and the 4s) do have 1GB RAM or more.

Am assuming that the reference to Raspberry Pi 3 and 4 might have been made without considering the above Model since otherwise there would be no need to exclude the Zero models, which also have 512MB of RAM.

[0] https://www.raspberrypi.com/products/raspberry-pi-3-model-a-...

I know how much memory the Pis support, I’ve owned every RPi since the very first one. Model As are lower specs than their B counterparts (eg the 3 B+ has 1GB of RAM) but that’s all moot because you and your siblings are still missing one important detail that I’ve stressed several times already and at this point I feel I shouldn’t have to making this point again, but…

Your application is not going to be 500MB!!

The OP completely misunderstood this entire premise of this project and every comment that has followed has been just as misinformed.

It’s almost comical just how badly you all have misunderstood this project yet still proceeded to lecture everyone about how unsuitable it and Go is. So let me explain one last time:

500MB is just a partition for you to put YOUR own application on. That application might only be 5 (five) megabytes or it could be 50MB but the partition needs to be large enough to offer some breathing room (eg logs, external assets if required, etc) and frankly for a non-embedded mini-PC, a 500MB partition isn’t a ridiculously high suggestion.

Clearly none of you guys bitching about the unsuitability of Go for the Pi have never actually used Go on a Pi or even bothered to read this GitHub readme. I’ve done both and frankly you’re all being ridiculous. Go works fine on the Pi (even the very first model) and no Go executable is going to be half a gigabyte(!!!) - I know Go binaries are large but stop for a moment to thing about the actual file size you are all talking about for a moment. Even Electon doesn’t inflate that big in most cases.

Honestly, it’s ridiculous the way you’ve all carried on. Did nobody stop to think for a moment before posting?