Repository navigation
Simplify deepcopy for potential performance improvements - #5277
Conversation
Signed-off-by: Jade Abraham <[email protected]>
To correct and amplify your point, we do better than that. If the data is large enough, using multiple cores to memcpy chunks of data results in much higher memory bandwidth utilization across different systems. By default, local array to array assignments benefit from that. I believe a typical C program that would copy "arrays" using a single memcpy would underperform compared to a Chapel application that copies arrays using array assignment as you are doing here. The default threshold for this to kick in is 2MB of data, and can be controlled via The PR that added the optimization has some data if you are curious: chapel-lang/chapel#16418 (comment) |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5277 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 44
Lines ? 1208
Branches ? 0
========================================
Hits ? 1208
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
drculhane
left a comment
There was a problem hiding this comment.
Simplicity is a beautiful thing.
Simplifies the
deepcopyimplementation to just use array assignment.The previous implementation in the 1-node cases would result in fine-grained array accesses and in the multi-node case would do manual slicing/bulk copies. However, the builtin array assignment operator is already optimized for this. In the single node case for a trivial array it will result in a single
memcpyand in the multi-node case it will result in a single memcpy per locale (assuming the same distribution).