Here is a simple program that makes 20 compounds each containing 250 cylinders, for a total of 5000 cylinders. It runs fine, so I don't know what problem your structure has.
from vpython import *
scene.width = scene.height = 600
scene.background = color.white
scene.range = 2
Ncompounds = 20
Ncylinders = 250
N = Ncompounds*Ncylinders
scene.title = '{} cylinders '.format(N)
def random_cylinder():
c = (vec.random() + vec(1,1,1))/2
return cylinder(pos=vec.random(), size=0.05*vec(1,1,1), color=c)
def make_compound(n):
cyls = []
for i in range(n):
cyls.append(random_cylinder())
return compound(cyls)
cs = [] # list of compounds
for i in range(Ncompounds):
cs.append(make_compound(Ncylinders))
while True:
rate(100)
for c in cs:
c.rotate(angle=0.02, axis=vector(0,1,0), origin=vector(0,0,0))