A Byte of Coding Issue 358

A Byte of Coding Issue 358

A Byte of Coding

Hi,

So earlier today someone posted on reddit and other tech social sites about Netlify charging them a $104k bill for traffic costs that resulted from a DDoS attack. What stands out to me is reading the comments and people harking about how cheaper traffic egress alternatives aren’t sustainable, which juts sounds like a load of baloney. Are people not aware that some cloud providers just charge absurd amounts for data transfer? For example, AWS charges $0.09 per GB for the first 10 TB / month. That comes out to about $900 / month. Hetzner on the other hand, gives you 10 TB / month for free (20 TB in some cases) and then charge around €1 / TB for anything beyond that. Do people just not shop around? This isn’t sponsored by Hetzner or anything (if you’re from Hetzner and reading this though, hit me up, I’d love to partner up because I use your servers exclusively), but it’s just wild to me that there can be such discrepancies in prices and people have no idea.

Anyway, here’s the issue.

Published: 26 February 2024

Tags: optimization, c++

David Gorski discusses “how branching and jumping in our code affects our runtime performance and how we can avoid them in our effort to reduce the latency of our programs”.

Some highlights:

  • jumping and branching add more instructions

  • “branching disrupts the smooth flow of instruction prefetching”

  • probably not useful for 99% of the code most people write (premature optimization being evil and all)

Published: 26 February 2024

Tags: c#

Jeremy Clark illuminates how Parallel.ForEachAsync works and what happens when exceptions are thrown while using it.

Some highlights:

  • the loop short-circuits if an exception is thrown (stops running)

  • “Parallel.ForEachAsync normally figures out how many resources to use on its own” for running in parallel

  • setting maximum limits on resources used can make the code more consistent when running on different machines

Published: 22 February 2024

Tags: networking, iot, hardware

Eric Johnson explores the difficulties of device connectivity management and then delves into techniques and metrics.

Some highlights:

  • lots of different moving parts make device connectivity complicated to manage

  • logging, protocol analyzers, and metrics can be used for debugging

  • connectivity metrics include sync success, connected time, and throughput

Leadership in TechA carefully curated weekly newsletter for CTOs, engineering managers and senior engineers to become better leaders.

Thanks for your Support!

Big thanks to all of the Patreon supports and company sponsors. If you want to support the newsletter you can checkout the Patreon page. It's not necessary, but it lets me know that I'm doing a good job and that you're finding value in the content.