The court usually doesn't care which spouse files for divorce first, particularly in California. This is a pure no-fault state, and you can only file on grounds of irreconcilable differences, or allege that your spouse is incurably insane. Because marital fault isn't an issue, both spouses have equal legal footing, regardless of who instigates the proceedings. Filing first might lend a few practical advantages, however, depending on your concerns.
California divorce law includes a provision for automatic temporary restraining orders, known as ATROs. This order goes into effect as soon as your spouse is served with a copy of your divorce petition. It prohibits her from leaving the state with your children, and from tampering with marital assets. If you're concerned about either of these issues, filing for divorce immediately offers you some protection. Additionally, California values assets for distribution as of the date of separation, so filing can help establish this date to the satisfaction of the court. You don't have to file first to achieve these things, but the sooner you do, the sooner they apply.
Filing vs. Service
Filing first in California can help ensure that your divorce will be heard in your county. If you and your spouse both file petitions in different counties, it comes down to which of you manages to serve the other with the paperwork first. The actual filing date of the petitions doesn't matter. If you serve your spouse first, your petition will prevail, and your county will have jurisdiction.