Live data from Hacker News

Cache-Conscious Data Layout in Rust: Field Zoning, False Sharing, 128-Byte Rule

debasishg.github.io

21–26 of 26 posts

Re: Cache-Conscious Data Layout in Rust: Field Zoning, False Sharing, 128-Byte Rule

#21
post #7

the best way to prevent false sharing is by making it so that no two threads are in a position to access the same data structure which may be inconsistent because it is being written to. embrace message passing.

Some of us work with industrial SoCs, with puny in-order Cortex-A7 cores and tiny L1/L2 caches. Sometimes, you really need to optimize for the hardware and micro-architecture you have in order to hit the performance goals required and message passing isn't always the answer.

Re: Cache-Conscious Data Layout in Rust: Field Zoning, False Sharing, 128-Byte Rule

#22
post #8

Earlier quoted context omitted.

I can recognize it too. For example, there's that particular archetype where the writing summarizes things by leading with a block quote. But I don't think that's a bad thing. To be honest, I actually think some AI style of speaking is effective for conveying information. People can have different opinions, of course. I write most things with my own hands. But if I feel like the AI's suggestion is better than what I…

For me the core of the anti AI argument has nothing to do with form and style - although that is how AI writing can often be identified. Its much simpler - if you cant be bothered to write it, I cant be bothered to read it. There is no communication happening otherwise. I can enter a prompt on my own.

There are some points where I disagree with that argument. It comes down to where you draw the line on human effort.

You're basically saying that hammering a nail with a regular hammer and hammering it with a power tool aren't the same act. Let me put it this way. I don't like fully AI generated writing either. But if I read something and can see traces that a human wrote the first draft and then refined it, then I don't really care if AI was involved.

It's just a question of where the effort is placed. And the real key is whether the right "keywords" are there or not. If you've actually used AI, you'll know that it's a layering tool. The output varies a lot depending on the layers of input you give it. No matter how much I prompt it about functional programming, I'm not going to get results that are deep or particularly good. This piece seems like someone put a fair amount of care into it, but I guess you see it differently.

Honestly, if the people who taught me or explained things to me had written at this level, I might agree with you. But most of the professors and people I've encountered didn't write this well this easily.

Re: Cache-Conscious Data Layout in Rust: Field Zoning, False Sharing, 128-Byte Rule

#23
post #22

Earlier quoted context omitted.

For me the core of the anti AI argument has nothing to do with form and style - although that is how AI writing can often be identified. Its much simpler - if you cant be bothered to write it, I cant be bothered to read it. There is no communication happening otherwise. I can enter a prompt on my own.

There are some points where I disagree with that argument. It comes down to where you draw the line on human effort. You're basically saying that hammering a nail with a regular hammer and hammering it with a power tool aren't the same act. Let me put it this way. I don't like fully AI generated writing either. But if I read something and can see traces that a human wrote the first draft and then refined it, then I d…

I have used AI fairly extensively to help me summarise info, or to explore topics I'm not familar with. But I don't use AI text directly in anything I write for consumption by other humans.

Aside from the fact you automatically reduce your audience, as there's lots of people who will be immediately turned off, I want to speak, not have a machine speak for me.

To take your hammer analogy, i will always use the hammer to hit the nail, but I might use a machine to help find a good place for the nail!

Re: Cache-Conscious Data Layout in Rust: Field Zoning, False Sharing, 128-Byte Rule

#24
post #22

Earlier quoted context omitted.

There are some points where I disagree with that argument. It comes down to where you draw the line on human effort. You're basically saying that hammering a nail with a regular hammer and hammering it with a power tool aren't the same act. Let me put it this way. I don't like fully AI generated writing either. But if I read something and can see traces that a human wrote the first draft and then refined it, then I d…

I have used AI fairly extensively to help me summarise info, or to explore topics I'm not familar with. But I don't use AI text directly in anything I write for consumption by other humans. Aside from the fact you automatically reduce your audience, as there's lots of people who will be immediately turned off, I want to speak, not have a machine speak for me. To take your hammer analogy, i will always use the hammer…

You have a point. I think it's just a matter of how we get information. It's a difference in values, and we're bound to see things differently. That said, this is how I think, and I don't plan to change my mind. You probably also think you're right, and given your situation, you probably are.

I respect your perspective. Have a good day, and I hope you understand that I didn't write my comment with any intention of attacking you.

Re: Cache-Conscious Data Layout in Rust: Field Zoning, False Sharing, 128-Byte Rule

#25

I don't get it. If the ring structure has 4 field (excluding the cold ones), and all 4 have alignment constraints, doesn't it define 4 zones in 4 cache lines, and not 2? I expected head and cached_tail, for example, to share the same line, but since they are both 128-byte aligned, they end up in separate lines. Granted, both lines are dedicated to only one side of the producer-consumer pipe, but we're wasting cache l…

It's LLM slop, what do you expect?

Re: Cache-Conscious Data Layout in Rust: Field Zoning, False Sharing, 128-Byte Rule

#26
post #24

Earlier quoted context omitted.

I have used AI fairly extensively to help me summarise info, or to explore topics I'm not familar with. But I don't use AI text directly in anything I write for consumption by other humans. Aside from the fact you automatically reduce your audience, as there's lots of people who will be immediately turned off, I want to speak, not have a machine speak for me. To take your hammer analogy, i will always use the hammer…

You have a point. I think it's just a matter of how we get information. It's a difference in values, and we're bound to see things differently. That said, this is how I think, and I don't plan to change my mind. You probably also think you're right, and given your situation, you probably are. I respect your perspective. Have a good day, and I hope you understand that I didn't write my comment with any intention of at…

Not at all - we dont have to agree but i enjoyed our discussion.
Post reply on HN