informa
2 min read
article

Bonus Feature: Data Alignment, Part 1

In Gamasutra's latest section-specific feature, veteran Noel Llopis tackles the topic of data alignment, offering solutions that can lead to real-world performance
In Gamasutra's latest section-specific feature, veteran Noel Llopis tackles the topic of data alignment, offering solutions that can lead to real-world performance increases in games. As Llopis explains in the programming-specific article, originally published in sister Game Developer magazine last year: "Data alignment refers to where data is located in memory... We care about alignment for a single reason: Performance." "In modern hardware, memory can only be accessed on particular boundaries. Trying to read data from an unaligned memory address can result in two reads from main memory plus some logic to combine the data and present it to the user," he says. "Considering how slow main memory access is, that can be a major performance hit." While Llopis warns that these solutions only apply to low-level languages like C and assembly, the article provides solutions -- despite what he identifies as C's drawbacks: "The C/C++ language falls short again, without a standard way of dealing with alignment." "Not only that, but we'll need to use different strategies to align data depending on how it is allocated: statically, on the heap, or on the stack. We're left at the mercy of compiler-specific extensions and our own home-brewed solutions." You can now read the full article on the subject, posted here as a Gamasutra feature, to learn the secrets -- including code samples and a diagram to illustrate the problem. The follow-up article, Data Alignment: Part 2, will appear on Gamasutra in the near future.

Latest Jobs

Studio Pixanoh LLC

Los Angeles, California
05.20.22
Combat Designer

Treyarch

Playa Vista, California or Vancouver, BC
05.20.22
AI Engineer

Question

Remote
05.20.22
Lead Level Designer (South Park)

Remedy Entertainment

Helsinki Metropolitan Area, Finland
05.23.22
Rigging Artist
More Jobs   

CONNECT WITH US

Register for a
Subscribe to
Follow us

Game Developer Account

Game Developer Newsletter

@gamedevdotcom

Register for a

Game Developer Account

Gain full access to resources (events, white paper, webinars, reports, etc)
Single sign-on to all Informa products

Register
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more