You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Protocol Buffers
What's the "best" (simplest, fastest) way to compare two protocol-
buffer objects? (in compiled_for=speed mode)
Kenton Varda
unread,
Oct 1, 2008, 4:21:26 PM10/1/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ojwl...@googlemail.com, Protocol Buffers
In which language? In Java you can just use .equals(). In C++, you could serialize the two and compare the bytes. Alternatively, you could write some code that iterates over the fields via reflection and compares them.
Chris
unread,
Oct 2, 2008, 3:26:01 PM10/2/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ojwl...@googlemail.com, Protocol Buffers
ojwl...@googlemail.com wrote: > What's the "best" (simplest, fastest) way to compare two protocol- > buffer objects? (in compiled_for=speed mode)
In what language?
In the Haskell implementation, it adds > deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable) to each message and this gives you printing, (==),(>),(<), etc.