Hacker News new | past | comments | ask | show | jobs | submit login

Performance. No additional I/O at startup and guaranteed to be in memory.



I don't know what platform you had in mind, but this isn't generally true for Linux. No part of a Linux executable is in memory except the page containing the main entry point, initially. You'd have to pre-fault the sections of interest and protect them with mlock to make sure they stay in memory. If you don't their cached pages may be dropped, which is essentially the same thing as swapping.

In short, these embedded assets are no more likely to be in memory than any other file-backed data. If you want to guarantee they are in memory, it is up to you to make that happen.


Even then, it avoids open, path traversal, read read read, close.

More important is avoiding having to answer the question "where are my assets".


Aren’t executable files loaded into memory page-by-page, on demand? There’s no guarantee that their contents are in memory.


Correct, it’s addressable in process memory space, but not guaranteed to be paged into memory until accessed.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: