If you have poor brake performance, you might have a problem with your master cylinder. The first step in a situation like this is to inspect the brakes at all four wheels and look for leaks. If the brakes are good and you don't see any leaks, then you might have a problem with your master cylinder.
The classic symptom of a bad master cylinder is that when you’re sitting at a stop, your brake pedal slowly sinks to the floor. You might even feel your vehicle creep forward at a stop. This usually means your master cylinder has failed. If that's the case, replace it.
Once again, you can rebuild a master cylinder, but it might be more trouble than it's worth. For that reason, I recommend you replace a master cylinder if you find it to be bad. One of the main things to remember when replacing a master cylinder is to bench-bleed it before you install it. Bench bleeding is the process of bleeding the air out of the master cylinder while it's out of the vehicle. I usually put them in a vice and work the piston after I fill the reservoir. They also make special tools that do this for you and make things easier. Sometimes a new master cylinder will even come with the parts to bench-bleed.
The takeaway, however, is that you do this before installing the master cylinder on the vehicle. If you don't, it might be very difficult to bleed the air out of the brake system after installation. Once you've installed your new master cylinder, it might be easier than you think to bleed out the system. I normally only have to bleed the system at the lines going to the master cylinder itself; I don't often have to bleed all four wheels when replacing a master cylinder. Here's a video with more details.
One last note about master cylinder replacement: You might find your master cylinder requires a push rod adjustment. Only do this if you absolutely have to. If you get this wrong, your brakes might not work properly or might lock up altogether. Follow the service procedure if you have to deal with adjusting the master cylinder pushrod.