This becomes a very grey decision when you base it on just numbers and metrics.
Disclaimer: i stayed 20++ and have a great check every month on the first, but i flew my whole career and my windows to bail were when hiring was marginal.
Best advice i got was to stick around as long as you are having fun (my definition was mainly did i get to go flying regularly) and they are promoting you. And i did, but when the fun meter came off the peg near the end, it only kept moving downwards, and quickly. Know a lot of folks who finished their 20 or 30 behind a desk and were miserable, and some were good to go and did the RJ experience and got on at a major.
Airline life is great. Happy to be here. But i would have been miserable if i did this as a LT or LCDR. There is a reason so many folks at that seniority get out and then work their butts off to get back into a reserve squadron.
Good luck.