clarifying why cic_paint_dx is slower

This commit is contained in:
Wassim KABALAN 2024-11-10 20:58:03 +01:00
parent 6256fbadb1
commit 2472a5d9df

View file

@ -244,6 +244,12 @@
"id": "02f18b52",
"metadata": {},
"source": [
"We note that **painting only displacements is slower** than painting absolute particle positions.\n",
"\n",
"This slower performance occurs because **painting displacements requires processing in smaller chunks or batches**. Instead of creating a large array of particle positions with neighbors (e.g., `(NParticles, 3, 8)`), which consumes a significant amount of memory, we paint the particles in manageable batches.\n",
"\n",
"This trade-off allows for greater memory efficiency but comes at the expense of speed. By reducing the memory footprint, we avoid memory limitations, especially useful in large-scale or distributed PM simulations, even if it means slightly slower painting.\n",
"\n",
"Well see in later notebooks that retaining only the displacement is essential for distributed Particle Mesh (PM) simulations, where memory efficiency and computational speed are key.\n"
]
}