Readit News logoReadit News
vkoskiv commented on Memory Efficiency in iOS: Reducing footprint and beyond   antongubarenko.substack.c... · Posted by u/CharlesW
potatolicious · 2 months ago
A key tip that wasn't in the blog post: be extremely judicious about taking on new code dependencies.

For many apps the main source of memory usage isn't stack or heap memory consumed during runtime, it's the loading of the binary itself into memory. I've seen some wild app binary sizes (200MB+ for relatively modest apps without that much functionality).

One thing that's endlessly frustrating about mobile dev is that the vast majority of devs are thoughtless about dependencies, how they are built/linked, and how that impacts memory use. Far and away the dominant mode of dependencies in mobile-land is just "statically link it and forget about it".

This is the singular biggest contributor to app size bloat, and pretty up there for runtime memory consumption as well.

A double whammy here is that modern iOS apps are actually multiple binaries (main app, watch extensions, widget extensions, etc.), and if you heavily use static linking you're carrying multiple copies of the bloat.

A few actionable things:

- Be very, very judicious about taking on new dependencies. Is a library offering enough value and marginal functionality to be worth the weight? (e.g., I don't think AFNetworking in 2025 meets the bar for the vast majority of people, but yet it's still everywhere?)

- Dynamically link, especially if you're a complex app with multiple targets.

- Deadstrip aggressively. I cannot emphasize this enough. The default compiler settings will not deadstrip unused public symbols in static libraries. Fix this.

vkoskiv · 2 months ago
> For many apps the main source of memory usage isn't stack or heap memory consumed during runtime, it's the loading of the binary itself into memory.

Does iOS not do demand paging?

vkoskiv commented on Making C and Python Talk to Each Other   leetarxiv.substack.com/p/... · Posted by u/muragekibicho
vkoskiv · 3 months ago
I did a lot of this for my raytracer, c-ray [1]. Originally it was just a self-contained C program, but I got tired of writing buggy and limited asset import/export code, so eventually I put together a minimal public C API [2] that I then wrapped with CPython bindings [3] and some additional python code [4] to expose a more 'pythonic' API. It's all still a WIP, but it has already allowed me to write a Blender plugin [5], so now I can play around with my renderer directly in Blender, and test with more complex scenes others have made.

Fun project, and it's really cool to see my little renderer in the interactive viewport in Blender, but I have also learned that I don't particularly enjoy working with non-trivial amounts of Python code.

[1] https://github.com/vkoskiv/c-ray [2] https://github.com/vkoskiv/c-ray/blob/51a742b2ee4d0b570975cd... [3] https://github.com/vkoskiv/c-ray/tree/51a742b2ee4d0b570975cd... [4] https://github.com/vkoskiv/c-ray/tree/51a742b2ee4d0b570975cd... [5] https://github.com/vkoskiv/c-ray/tree/51a742b2ee4d0b570975cd...

vkoskiv commented on Xerox Alto Source Code (2014)   computerhistory.org/blog/... · Posted by u/todsacerdoti
vkoskiv · 7 months ago
Somewhat related, curiousmarc has an absolutely brilliant video series from 2016 documenting the restoration of an Alto II:

https://www.youtube.com/playlist?list=PL-_93BVApb58I3ZV67LW3...

vkoskiv commented on ELKS: Linux for 16-bit Intel Processors   github.com/ghaerr/elks... · Posted by u/emersonrsantos
vkoskiv · 8 months ago
I recently added dual screen support to the ELKS console-direct driver, so if your system has both MDA and CGA cards, you enable CONFIG_CONSOLE_DUAL in your kernel config and select runlevel 5 in /bootopts, it will allocate 4 ttys, with one of them on the MDA display. You can see this setup running on my hardware in this pic in the README:

https://raw.githubusercontent.com/ghaerr/elks/refs/heads/mas...

I could use some help testing it on EGA and VGA hardware, as I don’t have any 8 bit cards for those in my collection.

vkoskiv commented on Show HN: SHAllenge – Compete to get the lowest hash   shallenge.quirino.net/... · Posted by u/quirino
vkoskiv · a year ago
Wasn't expecting to stay in the top 100 for this long!

Initial C implementation got me to ~70 for a short time, then very sloppy racy pthreads one kept me at the tail end for a bit longer, but my again very sloppy cuda program running on my GTX1070 has me at 35 at the time of writing.

Rough calculation shows it to be doing 28.6MHashes/sec, and I suspect I could do a lot better than that if I knew anything about cuda programming.

I didn't read enough to know how to pick good values for blocks/threads per block, so I just benchmarked all the combinations of powers of two to arrive at the best result.

Really fun challenge!

Would be fun to see the total amount of valid submissions, and maybe the number of leading zeroes of a hash for those of us that need a moment to figure it out from hex in their head :]

vkoskiv commented on Libtree: Ldd as a tree saying why a library is found or not   github.com/haampie/libtre... · Posted by u/fanf2
vkoskiv · a year ago
In case anyone else is wondering what the colors mean (I couldn't find this in the manpage/README):

Magenta: In exclude list (only shown with -v[v[v]])

Blue: Seen before (so you can spot which dependencies appear multiple times)

vkoskiv commented on I'm forking Ladybird and stepping down as SerenityOS BDFL   awesomekling.substack.com... · Posted by u/zmodem
hashtag-til · a year ago
Not really sure how Discord is popular, given it is impossible to search.
vkoskiv · a year ago
It's popular because anyone can create their own community with just a few clicks, and it's all paid for by friendly venture capitalists :]
vkoskiv commented on Assembly   assembly.louve.systems/... · Posted by u/shpx
vkoskiv · a year ago
Heh, my program that just copies the current instruction to +1 wasn't allowed on the board, fair enough I guess :D
vkoskiv commented on NPM package is-even has over 140k weekly downloads   npmjs.com/package/is-even... · Posted by u/r_singh
vkoskiv · a year ago
Am I missing something here, why is a package even needed needed for this? Can you not evaluate `some_int % 2` in Javascript to check for this directly?
vkoskiv commented on PicoMEM by FreddyV – All in One 8-Bit ISA Expansion Card   texelec.com/product/picom... · Posted by u/mysterydip
vkoskiv · a year ago
A similar project for PCMCIA[1] is being developed by yyzkevin. Really exciting IMO, not yet available, but I submitted a response to their google sheet, hoping to get one of these when the preorders start.

[1] https://www.youtube.com/watch?v=YoJ12leojwo

u/vkoskiv

KarmaCake day644November 29, 2017View Original