There is an overhead in creating string object from the message.
It is more faster to obtain direct pointer to the data and length of
it.

  inline bool has_name() const;
  inline void clear_name();
  static const int kNameFieldNumber = 1;
  inline void set_name(const ::std::string& value);
  inline void set_name(const char* value);
  inline void set_name(const char* value, size_t size);


So it will look instead of:
  inline const ::std::string& name() const;  //problem here need
creation of string -> very slow!
Something like:
  inline const char* name() const;  //zero copy
  inline int size_name() const;       //size information.


There is possilility to copy string one by one character but it is
even worse :(

Regards \/.
-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.


Reply via email to