How to optimize this script to render 1 millions of cubes in same screen?:

This is (often) more expensive than regular LODs.

If you remove “in C++” it will be more honest. :melting_face:
Everything can break at any moment, so you just need to make backups and you can save on antidepressants.

( ͡° ͜ʖ ͡°)
It seems that you have never had your blueprints break after changing the blueprint structures?)

I assure you, once you understand what possibilities C++ gives you (and what, alas, Blueprint does not have and is unlikely to have) - you will not be able to refuse it. In addition, you can (should) extend the capabilities of Blueprint itself using C++, so that the development process is as enjoyable as possible.

*HierarchicalInstancedStaticMeshs

This is definitely what you need.
You may need to split all meshes into multiple HISM components to get better performance.