Skip to content

Commit af793f1

Browse files
committed
typos
1 parent 3cb248d commit af793f1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

_posts/2025-01-19-DOPvsOOP.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ OOP (Good Order by DOP) Execution time: 0.00575244 seconds
173173

174174
Again a better result. This indicates that we are not thinking nonsense, but we can go even further, and this is just transfering to code naive knowledge about CPU architecture...
175175

176-
> Note: With the command ```$ lscpu``` you can view the information about my CPU, to see the size in bytes that the CPU queries in each cycle, in order to know how to maximize the efficiency of my structure to avoid unnecessary gaps and perform operations in the fewest number of cycles (L1 and L2 cache sizes, 64-bit data bus size, etc.).
176+
> Note: With the command ```$ lscpu``` you can view the information about your CPU, to see the size in bytes that the CPU queries in each cycle, in order to know how to maximize the efficiency of my structure to avoid unnecessary gaps and perform operations in the fewest number of cycles (L1 and L2 cache sizes, 64-bit data bus size, etc.).
177177
178178
### ```Entity_OOP_GoodWithFooPadding```
179179
Now we manually add the necessary padding to align the data with the 64-bit boundaries of our CPU's memory architecture:
@@ -251,8 +251,6 @@ Below are the graph results after running the test many (1000) times and analyzi
251251

252252
Mostly, the results align with what was experienced before; careful structuring of variables in memory enhances performance on both small and large scales, even with the optimizations that modern compilers may add.
253253

254-
**GRAPH**
255-
256254
### Conclusion
257255
Modern CPUs access memory in blocks (typically 8 bytes or more). If the data is properly aligned in memory, access is faster because it can load and store the data in a single memory cycle. If the data is not properly aligned, the CPU may have to perform more memory accesses, which introduces performance penalties due to the need to correct the alignment at runtime.
258256

0 commit comments

Comments
 (0)