Routines often have problems if they have more than about 15 devices in them. They are the oldest automations that smartthings created, and in fact Have been dropped from the new app altogether.
There are several different approaches you can try that might run faster.
try using the official smart lighting feature instead of routines for this. That’s newer code. You can use it with a scene or with the individual devices.
create multiple routines each with about a dozen devices and have them all trigger from the same virtual switch. Then just toggle the virtual switch on and off.
Group the lights to a virtual device using the smart lights mirror feature, then toggle the master on or off. I don’t have any idea whether this option or the second option would run faster, or if there would be any noticeable difference at all.
- set up two scenes, one with all lights on and one with all lights off. That might be the fastest method, you’d just have to try it, but a lot of people don’t like having to remember the names of both scenes since you can’t turn a scene “off.“
Anyway, I would suggest just trying smartlights first, because that’s the current recommended method for working with lights. And it will work in both the classic and the new app.