MaterialPropertyBlock example request

I’m looking for an efficient way to render lots of cubes with different colors for a data visualization application.
Currently, I simply create a standard cube and set the color property. However, this creates a new material for every cube, which I would like to avoid.
It looks like MaterialPropertyBlock will allow me to create many cubes with many different colors with 1 draw call, but I can’t find any examples of how to implement this class.

Please help!

if you create lots of primitives, it uses unshared material, you cna also instantiate a prefab or a cube already in gameplay, it will copy paste it.

at any time, change or set the sharedMaterial to keep same materials. in gameobjects, 2500 is pretty reasonable number of them on screen at one time.