Recent

Author Topic: What is more (memory) efficient  (Read 3282 times)

ALLIGATOR

  • Full Member
  • ***
  • Posts: 136
Re: What is more (memory) efficient
« Reply #45 on: February 06, 2025, 08:14:29 am »
What makes you believe that with the proposed code you are analyzing the performance of the processor cache?

Different step size for accessing data in memory

DragoRosso

  • Guest
Re: What is more (memory) efficient
« Reply #46 on: February 06, 2025, 09:01:01 am »
Yes, that was a good article to understand how the cache works.

But, you don't know how the compiler optimize or simply "translate" your code. May be in assembler view should be the better way to analyze the fact. And you are sure about your interpretation of memory cache alghoritm ? I don't think that someone know it to determine exactly the function in this way (multi-level N-way set-associative caches questions).

Other important things is that you are running a simple "routine" in a user level, with lower priority than the other "routines" of your system like drivers or others software that run at kernel mode or at other priority level.

So you are "measure" the performance of your system, not cache processor, 'cause your routine wil be interrupt a lot of time, and you don't know if your code is running in more than one thread (also inside the same core).

Other things are about all new "innovation" with new architecture like hybrid core, ITD (Intel thread director) and others ...

ALLIGATOR

  • Full Member
  • ***
  • Posts: 136
Re: What is more (memory) efficient
« Reply #47 on: February 06, 2025, 09:46:32 am »
But, you don't know how the compiler optimize or simply "translate" your code. May be in assembler view should be the better way to analyze the fact.
I'm well aware of how this code optimized the compiler - since I'm looking at it, you're hopefully aware of this feature?

---

Other important things is that you are running a simple "routine" in a user level, with lower priority than the other "routines" of your system like drivers or others software that run at kernel mode or at other priority level.

So you are "measure" the performance of your system, not cache processor, 'cause your routine wil be interrupt a lot of time, and you don't know if your code is running in more than one thread (also inside the same core).
Well, come on, because you yourself said that the article is good - so read it ) it says in black and white how you can determine the size of caches and their latency, at a fairly accurate level being in the third ring under the operating system. Again, it is not a problem for those who know what they are doing. For those who do not understand - yes, it may seem like magic!
Yes, that was a good article to understand how the cache works.

---

Other things are about all new "innovation" with new architecture like hybrid core, ITD (Intel thread director) and others ...
The technologies you have listed are easily configurable from the user mode, and even a simple setting of the correspondence to the processor core will level their influence up to 0


ALLIGATOR

  • Full Member
  • ***
  • Posts: 136
Re: What is more (memory) efficient
« Reply #48 on: February 06, 2025, 09:50:35 am »
What makes you believe that with the proposed code you are analyzing the performance of the processor cache?

In turn, then I have to ask you - what makes you doubt that my code is not related to cache access performance analysis?

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 866
Re: What is more (memory) efficient
« Reply #49 on: February 06, 2025, 10:25:05 am »
If memory isn't issue, then it's better to rely on default alignment, as it's better for performance.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

440bx

  • Hero Member
  • *****
  • Posts: 5078
Re: What is more (memory) efficient
« Reply #50 on: February 06, 2025, 11:41:34 am »
If memory isn't issue, then it's better to rely on default alignment, as it's better for performance.
Actually, the measurements shown in this thread give a strong impression of the opposite being true.

The default is unpacked, which means aligned.  The measurements shown in this thread show that accessing fields in a packed structure is faster.

Honestly, in spite of the results that have been posted in this thread, I still believe that aligned data is accessed faster.  I suspect/guess that the results seen here are more likely to be a result of the compiler's ability to optimize some cases better than others, not really due to differences in access speed due to alignment.  That said, I'd be really hard pressed to prove this belief.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

DragoRosso

  • Guest
Re: What is more (memory) efficient
« Reply #51 on: February 06, 2025, 11:51:34 am »
What makes you believe that with the proposed code you are analyzing the performance of the processor cache?

In turn, then I have to ask you - what makes you doubt that my code is not related to cache access performance analysis?
I don't have any doubts, I'm certain that your code is not related to cache (EDIT: TO MEASURE THE PERFORMANCE OF), I hoped that you explain why you think so, but you only explain about facts that are not in your code.

I don't want to continue useless polemics. So for me the discussion ends here.
Sorry if I questioned what you proposed.
« Last Edit: February 06, 2025, 12:07:46 pm by DragoRosso »

 

TinyPortal © 2005-2018