Optimizations for client code based on profiling results

Also upgrade to protoc 2.5.0