socketry / async-dns

An asynchronous DNS resolver and server.
MIT License
96 stars 14 forks source link

Review performance regressions. #1

Open ioquatix opened 7 years ago

ioquatix commented 7 years ago

We should be both faster than Bind9 and native resolver. Check why this has regressed.

ioquatix commented 7 years ago

I think I found the cause of the problem. There is an excessive amount of logging due to $DEBUG being set in Travis. For these performance specs, perhaps it should be disabled.

tarcieri commented 7 years ago

Travis is generally an unreliable place to run benchmarks

ioquatix commented 7 years ago

I appreciate that feedback.

The problem here is the use of $DEBUG to determine a default log level here:

https://github.com/socketry/async/blob/master/lib/async/logger.rb

I think it's not a bad choice except it's causing issues in this particular case. The solution is to disable it for the performance specs e.g. before(:all) { Async.logger.level = Logger::WARN }and the appropriate one afterwards, but there is more than one performance spec, so a shared context would be good here. I actually have a shared context in another project which includes support for Benchmark, RubyProf and some other basic profiling tools, it's really easy to use. I'll probably copy it across.