Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7554317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:18:22+00:00 2026-05-30T11:18:22+00:00

If I am writing values to memory, and not reading them again, does it

  • 0

If I am writing values to memory, and not reading them again, does it have any performance impact if the memory locations are not contiguous? (ie not in the write cache)

Can the processor write them to memory in the background when it has a chance, or does it cause cache problems?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:18:23+00:00Added an answer on May 30, 2026 at 11:18 am

    Most caches in CPUs were familiar with are write-back, meaning that writes are not propagated to the next level of the memory hierarchy until there’s contention for cache space, and something has to be flushed. If you make a single random write, you’re unlikely to see any performance effect, but if you make sustained random writes, you will find that its performance will be significantly lower than sequential writes.

    Making a random write is likely to require allocation of a cache line, because it’s likely to be the only thing accessed in that segment of memory. Once you have made enough writes, you’ll have filled up the data cache with lines that each contain one valid word, and one of the lines has to be flushed. Because of the way memory is organized and accessed, that flush won’t be much faster than flushing an entire line, making that random write be about the same speed as 32 bytes (typical line size) of sequential writes.

    I would recommend writing your own program to test this. Allocate memory much larger than your last-level cache and time the same number of random and sequential 32-bit writes. I’m betting you’ll find the random writes to be somewhere between 1/8 and 1/4 as fast as the sequential.

    Another factor, for YOU is the relative balance of random writes to other computation that doesn’t access memory. If they’re rare, yes, they’ll get flushed pretty much in the background. It’s only when they become a bottleneck that you’ll notice performance impact. The same problem happens with sequential writes, but not as severely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Unfortunately the solutions have not worked yet; setting result.values pointer to 0 doesn't actually
I have writing a multi threaded code. I am not sure, whether I would
I have been writing C for only a scant few weeks and have not
The .NET 4.0 Framework introduces classes for reading and writing memory mapped files .
According to here , the C compiler will pad out values when writing a
i'm writing some code for getting some values including course -(void) locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation
I'm writing a unit test for a method that packs boolean values into a
I am writing a system which requires me to fetch the values of properties
i am writing stored procedures in MySQL that return values; CREATE PROCEDURE getCustomerById (id
I am writing an iPhone application which requires the user to enter several values

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.