•
Twilio • 1y
Did you know that you can optimise memory by changing the order of struct fields in Go? Its fascinating! Right? I didn't know this until I saw this for myself in a reddit thread's example. Now this is not a new thing. Programming languages like C/C++ already has this concepts up and running for decades. Turns out, most processors access data more efficiently when data is aligned to certain byte boundaries (e.g., 2, 4, 8 bytes). For instance, an int64 (which is 8 bytes) is most efficiently accessed when stored at a memory address that is a multiple of 8. To achieve this alignment, Go automatically adds padding between fields in a struct. This padding can increase the size of a struct if fields are not ordered optimally. By ordering fields from largest to smallest, you minimise the amount of padding required between fields, resulting in a smaller overall memory footprint. Here are the links that where I found this: The Example: https://go.dev/play/p/MBXg4UBOerp The Thread: https://www.reddit.com/r/golang/comments/qcab7p/you_can_optimize_memory_by_changing_the_order_of/
Co-founder at social... • 8m
🚀 Big Moves from Social Struct! We’re thrilled to announce that Social Struct, our growing influencer marketing agency, is expanding its reach to Kolkata! From connecting powerful local influencers to forward-thinking brands, we’re building real
See MoreCo-founder BYTES • 1y
Announcing BYTES: India’s First AI-Powered ADAS for Safer Two-Wheeler Mobility After months in stealth mode, I am thrilled to unveil BYTES, our venture dedicated to transforming mobility with innovation and safety at its core. Why This Matters: -
See MoreTechnology, Developm... • 1y
Western Digital recently launched a groundbreaking 4 TB digital memory card for mobile devices. This cutting-edge memory card is slated to be available from next year onward and boasts a data transfer speed capable of reaching up to 104 MB per second
See More
Hey I am on Medial • 1y
This is a B2B offer for individuals to earn part-time while helping students explore new fields such as aviation engineering and safety engineering. We have tie-ups with several institutions specializing in these fields. If a student enrolls, we wil
See MoreB.Tech Student | Dat... • 11m
Looking for Co-Founders & Team: Building AI-Powered Synthetic Memory for Humans! Imagine a future where you never forget an important conversation, an idea, or a moment. We’re building an AI-powered Synthetic Memory System—a revolutionary way to cap
See MoreDownload the medial app to read full posts, comements and news.