Lemmy.cat
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
git [he/him, comrade/them]@hexbear.netM to programming@hexbear.netEnglish · 4 months ago

Data Access Patterns That Makes Your CPU Really Angry

blog.weineng.me

external-link
message-square
0
link
fedilink
1
external-link

Data Access Patterns That Makes Your CPU Really Angry

blog.weineng.me

git [he/him, comrade/them]@hexbear.netM to programming@hexbear.netEnglish · 4 months ago
message-square
0
link
fedilink
Check out the discussion on reddit. Given an array of data, what is the slowest way to sum up the integers? Is it adding the numbers from left to right, adding them randomly, or doing something else? In this post, we are going to build a data access pattern from the ground up that sums numbers as slowly as possible by exploiting memory pitfalls. uint32_t* data = ...; // sequential data[0] + data[1] + data[2] + ... // random data[67] + data[69420] + data[42] + ... // the slowest data[A] + data[B] + data[C] + ... Spoiler: You can do >30% worse than a randomized access pattern.
alert-triangle
You must log in or register to comment.

programming@hexbear.net

programming@hexbear.net

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programming@hexbear.net
  1. Post about programming, interesting repos, learning to program, etc. Let’s try to keep free software posts in the c/libre comm unless the post is about the programming/is to the repo.

  2. Do not doxx yourself by posting a repo that is yours and in any way leads to your personally identifying information. Use reports if necessary to alert mods to a potential doxxing.

  3. Be kind, keep struggle sessions focused on the topic of programming.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 5 users / day
  • 5 users / week
  • 5 users / month
  • 5 users / 6 months
  • 1 local subscriber
  • 312 subscribers
  • 50 Posts
  • 0 Comments
  • Modlog
  • mods:
  • Llituro [he/him, they/them]@hexbear.net
  • git [he/him, comrade/them]@hexbear.net
  • BE: 0.19.21
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org