S&W used to tell 3rd gen armorers to replace recoil springs based upon length, but that was obviously a bit imprecise. My notes from my first armorer class state that 1-2 coils shorter (than a new spring) is probably not a problem, but 3-4 coils shorter will cause "extractor jump" (failure-to-extract). Well, I've seen NIB/unissued guns exhibit 1-2 coil shorter recoil springs just from having been left with an orange factory empty chamber flag left in the boxed gun for a handful of years (compared to a brand new recoil spring that had never been in gun).
In subsequent classes they simplified things and started telling armorers to replace recoil (& mag) springs in service weapons either every 5 years or every 5,000 rounds, whichever occurred first. I've heard it said that this was a safe, conservative estimate when it came to guns that had to be relied upon as dedicated defensive weapons.
I've heard that the harder recoiling .40's are harder on recoil springs than the 9's & .45's, too. Unsurprising.
While the recommendation for the compact & subcompact (CS series) pistols are the same as for the full-size 3rd gen's - meaning 5yrs/5K rounds - I tend to be a bit more conservative in replacing the springs in my own smaller 9/.40/.45 guns, especially if I'm shooting +P/+P+ in the 9's and +P in the .45's.
I remember in my Colt 1911 pistol armorer class (what they call the Model O Pistol class), the instructor said the recoil & mag springs probably ought to be replaced every 1,200-1,800 rounds, depending on the ammunition being used (meaning toward the shorter round count if +P is used). I asked an aftermarket spring maker how long their extra tension recoil springs ought to run in 1911's, and was told their stronger recoil & mag springs might run out to 2,500 or more rounds and provide reliable service. Maybe.
Do people run 1911 recoil & mag springs longer? Sure. Some have no problems, and some run into problems. Some folks go longer between oil changes in their motor vehicles and run their tires until the steel belts start to show through, too.
Whenever I've heard how some front sight post bases and slide stop levers have cracked or broken in hard-used 1911's, I've always asked the shooter (or other armorer supporting them) how long they've run the guns between spring changes, and the answer is usually longer than I'd run them.
Ditto seeing some of the guys running "special enforcement" full-size steel 1911's when it comes to replacing mag springs. When one guy experienced repeated feeding failures & stoppages in a couple of his mags during a qual course-of-fire, and he couldn't remember how many rounds it had been since his last re-springing of the mags ... I could only shake my head and recommend he go see his unit armorer for new springs. He'd walked onto the range carrying the weapon in that condition, too.
Personally, I prefer to replace recoil & mag springs before they show signs of obvious weakening during range sessions.

I check the mag springs at the bench during each cleaning session, making sure they lock back the slide (on an empty gun) when an empty mag is in the gun and the slide is briskly run hard to the rear. Sometimes I've had to replace a mag spring sooner than expected, but that's the way it can sometimes go, right?
FWIW, over the years of attending armorer classes for some other makes/models of service pistols, and listening to armorers come back from similar classes, I've noticed that recommendations for recoil & mag spring replacement (and some other springs) have changed, as well.
In my last Glock recert they said the RSA's need to be replaced about every 5K in Gen4 models (or sooner, if needed), and between 2-3K in older models ... and the instructor went on to say that it was probably better to replace the RSA's in the older guns closer to 2K than 3K, and that fresh springs kept guns alive (especially the .40's).
Springs are relatively inexpensive maintenance items, especially when compared to ammo expenditures, right?
Just my thoughts.