-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changed the String() method for UUID's #174
Conversation
Very interesting. After having optimized this, what effect did you see on the performance of the app as a whole? |
On Wed, May 21, 2014 at 02:50:51PM -0700, Ben Hood wrote:
|
I've just run your benchmark myself:
It does look like it has a significant performance improvement without affecting the functionality. So I would be in favor of merging this - but I would like one of the other maintainers opinion on this, since this the first performance related patch we have received. |
Looking over the pr I have to ask:
|
good look @nemothekid I just pushed another commit addressing these issues. |
There is no need to export
It seems to perform sightly faster here. Oh, and it would be nice if you could also add your benchmark as |
I have changed it to use the offsets array. |
changed the String() method for UUID's
LGTM. Many thanks for your contribution! :) |
…ions When LWT optimization was implemented in gocql (scylladb#49), all `newFramer` calls were replaced with `newFramerWithExts` calls. Previously, during the upstream merging the code using `newFramer` was added (scylladb#109) and it was forgotten to replace it with `newFramerWithExts`. That way, the `flagLWT` field was set to `0` by default, causing the driver to consider every query executed as a LWT query. The issue was not immediately noticed because the only difference in behavior occurs when we want to use `ShuffleReplicas()` in `TokenAwareHostPolicy`. This commit fixes the issue by replacing `newFramer` with `newFramerWithExts`. Fixes: apache#174
I was profiling some code for work, that uses the UUID.String() method a lot and saw it was using fmt.Sprintf(), which is a bit overkill, if you ask me. I changed it to use a switch statement. It is now between 4-6 times faster. Here is a benchmark.