Profile picture
Jamie Hayes @jamiehayes81
, 9 tweets, 2 min read Read on Twitter
Here are some pieces of advice for aspiring low-level programmers:
1. Profile your code often. Learn what parts of your code take longer than others. When it comes time to optimize, you'll know what parts of your code will benefit from some clean-up/optimization
2. Check the disassembly of your code. Use mixed view (source & asm) to understand what instructions are generated for your code. Both with optimizations and without. Learn what your compiler is doing. Experiment at gcc.godbolt.org
3. Learn the calling conventions of the ABI on the platforms you target. It'll help you debug crashes that occur in optimized builds, as well as help you understand how best to pass arguments to your functions.
4. Learn about atomics and how they work. They are the cornerstone for fast multi-core and lock-free programming. Practice by writing lock-free data structures from scratch.
5. Learn about caches and memory accesses. Use this knowledge to format your data in a way that takes advantage of cache-locality.
6. Get intimate with floating point numbers and their binary representations (i.e. seeing 0x3f800000 in your memory view should ring bells). Read @BruceDawson0xB's blog for some excellent information about floats.
7. Play around with SIMD for your platform(s). Don't count on the compiler to do it for you. Sometimes you'll have to use SIMD intrinsics to get the best performance out of your code.
I'll let my other, smarter colleagues chime in here for more gems
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Jamie Hayes
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert is as a PDF, save and print for later use!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!