I think the @synchronizer is just adding an indirection which isn't useful and
just adds a small performance penalty for 99% of the users doing Redis.connect.
Remove the option for :thread_safe.
I'm +1, let's hear from @soveran and @pietern.
Yes, sounds good. If users still want to disable it they can #include a fake Monitor mixin.
So how do you disable thread safety now? Is it as simple as this or am I missing something?
def synchronize; yield; end
@pietern Can you give an example of your fake MonitorMixin? I am never using threads and monitors degrade performance significantly [EDIT: this is wrong, see below].
You can do that, or subclass Redis.
But clearly – why would you want to do that?
@djanowski Performance. I have to benchmark that again but I used to disable thread safety because I had noticed an important decrease in performance due to Monitor.
Check again, both @cyx and I made benchmarks and the impact was negligible.
I just did a quick bench and I found that the impact was indeed negligible.
My switch to thread unsafe goes back to February 2011 according to git so maybe things have improved in the meantime or maybe I was doing something wrong back then.
Anyway I will use the thread safe version unless I encounter problems again, in which case I will create a dedicated issue.