Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotMB to Lobste.rsEnglish · 1 month 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

RSS BotMB to Lobste.rsEnglish · 1 month ago
message-square
0
link
fedilink
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.

Comments

alert-triangle
You must log in or # to comment.

Lobste.rs

lobsters

Subscribe from Remote Instance

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: !lobsters@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

RSS Feed of lobste.rs

Source of the RSS Bot

Visibility: Public
globe

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

  • 42 users / day
  • 130 users / week
  • 414 users / month
  • 1.69K users / 6 months
  • 2 local subscribers
  • 391 subscribers
  • 15.3K Posts
  • 1.06K Comments
  • Modlog
  • mods:
  • patrick
  • RSS Bot
  • BE: 0.19.15
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org