I wouldn't expect much of a performance difference using bytes.Buffer.
Underneath, it basically is just a byte slice and an offset like what
you have now. There'd be a small increase in runtime due to function
call overhead and some additional memory costs, but I personally think
the simpler code is worth it. encoding/binary's Read and Write
functions would likely be slower due to the reflection code, so it's
understandable if you wouldn't want that.
> Other priorities are adding features, implementing the protocol better, correct previous mistakes, avoid duplicated code like current release branch etc.
Got it. Any interest in having compression implemented? It seems like
that would be an easy one to tackle, with zlib already part of the
core Go library.
> Certainly be interested to see a simple usage example based on latest dev code if you have time. I'll have to work on some benchmarks to compare processing time etc.
Sure. The easiest thing to do might be to set up a Client that
communicates with a dummy server. That should eliminate variations due
to different servers and mean that the benchmarker doesn't have to
enter things like username and password. (This won't work if you're
actually interested in benchmarking the server, of course, but I'm not
sure why you would be.)
Then it's just a matter of figuring out what commands/packets you want
to pass through.
- Evan
On Thu, Jan 27, 2011 at 11:49 AM, Phil Bayfield <ph...@bayfmail.com> wrote:I wouldn't expect much of a performance difference using bytes.Buffer.
> I'm quite interested in finding the fastest and most efficient way to handle packets.
> The thinking behind the current dev code is that using a slice would be quicker than calling additional libraries and as it's a reference type I can manipulate it a fair bit without any additional memory usage cost.
Underneath, it basically is just a byte slice and an offset like what
you have now. There'd be a small increase in runtime due to function
call overhead and some additional memory costs, but I personally think
the simpler code is worth it. encoding/binary's Read and Write
functions would likely be slower due to the reflection code, so it's
understandable if you wouldn't want that.
> Other priorities are adding features, implementing the protocol better, correct previous mistakes, avoid duplicated code like current release branch etc.Got it. Any interest in having compression implemented? It seems like
that would be an easy one to tackle, with zlib already part of the
core Go library.
> Certainly be interested to see a simple usage example based on latest dev code if you have time. I'll have to work on some benchmarks to compare processing time etc.Sure. The easiest thing to do might be to set up a Client that
communicates with a dummy server. That should eliminate variations due
to different servers and mean that the benchmarker doesn't have to
enter things like username and password. (This won't work if you're
actually interested in benchmarking the server, of course, but I'm not
sure why you would be.)
Then it's just a matter of figuring out what commands/packets you want
to pass through.
- Evan
--
You received this message because you are subscribed to the Google Groups "GoMySQL" group.
To post to this group, send email to gom...@googlegroups.com.
To unsubscribe from this group, send email to gomysql+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gomysql?hl=en.