It depends.
Let's say defense is provided for the defendant because they are too poor to afford their counsel. Then the court provided counsel is expected to provide a competent level of defense before and during trial. Sometimes they may recommend that a defendant waive their right to a speedy trial, in order to give them additional time to create a solid case for dismissal. But that remains a right that can only be waived by the defendant. And regardless, if the defendant doesn't waive the right, then they are still owed a solid defense. Otherwise all charges can be dismissed.
If the defendant can afford their own defense, then the onus is on their lawyers to advise the defendant of the best course of action. The government is not responsible for you deciding to hire a shitty lawyer though.
There are time limits, yes. Those time limits should be set in accordance with making sure that a proper trial is had, and the rights of the defendant (who is still innocent in the eyes of the law) are not violated. If a judge (not the CPS) deems that the evidence mandates an extended period in detention, then fine, although I would rather avenues for home detention be explored, where the defendant is not allowed to be a danger to the public, yet still can be free in their home abode pending trial.
I typed all of that not realizing we are on the same page, but there you go