Commit 351988f6 authored by Hanno Schlichting's avatar Hanno Schlichting

Avoid key calculation overhead for fast queries

parent b0b04404
...@@ -187,13 +187,16 @@ class CatalogReport(StopWatch): ...@@ -187,13 +187,16 @@ class CatalogReport(StopWatch):
self.log() self.log()
def log(self): def log(self):
key = make_key(self.catalog, self.request)
# result of stopwatch # result of stopwatch
res = self.result() res = self.result()
if res[0] < self.threshold: if res[0] < self.threshold:
return return
# The key calculation takes a bit itself, we want to avoid that for
# any fast queries. This does mean that slow queries get the key
# calculation overhead added to their runtime.
key = make_key(self.catalog, self.request)
reports_lock.acquire() reports_lock.acquire()
try: try:
if self.cid not in reports: if self.cid not in reports:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment