Add debug timings for SQL
This commit is contained in:
parent
57d96a4512
commit
6ce52f39ae
@ -22,6 +22,8 @@
|
||||
|
||||
from PyQt5.QtWebKit import QWebHistoryInterface
|
||||
|
||||
from qutebrowser.utils import debug
|
||||
|
||||
|
||||
class WebHistoryInterface(QWebHistoryInterface):
|
||||
|
||||
@ -48,7 +50,8 @@ class WebHistoryInterface(QWebHistoryInterface):
|
||||
Return:
|
||||
True if the url is in the history, False otherwise.
|
||||
"""
|
||||
return url_string in self._history
|
||||
with debug.log_time('sql', 'historyContains'):
|
||||
return url_string in self._history
|
||||
|
||||
|
||||
def init(history):
|
||||
|
@ -24,6 +24,7 @@ import re
|
||||
from PyQt5.QtSql import QSqlQueryModel
|
||||
|
||||
from qutebrowser.misc import sql
|
||||
from qutebrowser.utils import debug
|
||||
|
||||
|
||||
class SqlCategory(QSqlQueryModel):
|
||||
@ -81,5 +82,6 @@ class SqlCategory(QSqlQueryModel):
|
||||
# treat spaces as wildcards to match any of the typed words
|
||||
pattern = re.sub(r' +', '%', pattern)
|
||||
pattern = '%{}%'.format(pattern)
|
||||
self._query.run([pattern] * self._param_count)
|
||||
with debug.log_time('sql', 'Running completion query'):
|
||||
self._query.run([pattern] * self._param_count)
|
||||
self.setQuery(self._query)
|
||||
|
Loading…
Reference in New Issue
Block a user