Collision detection sketch running extremely slow

Hi,

I’m working on a sketch drawing circles and squares that slowly fall to the bottom of the window and begin to stack. I first got things to work using matter.js here:

https://editor.p5js.org/bdooley7/sketches/yY5Ej6Sso

and now am trying to get the same effect without it:

https://editor.p5js.org/bdooley7/sketches/1-AXB2LKk

I am now running into a problem with the sketch running extremely slow/glitchy after drawing even just one or two shapes. I think this may have to do with the shapes being added in the draw() function every X frame and then checking for collisions, although I am not sure…

I would greatly appreciate any help. Thank you in advance!