You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The StmtCache currently does a linear probe of the order vector (including a string comparison for each position) every time it looks up a query. This is fine if the statement cache is fairly small, or a small set of queries are very common, but if it is larger, this scan + remove + push can become quite costly. From what I can tell, it is only used for keeping an LRU of the items in the HashMap. If the values in the map were instead, say, (usize, InnerStmt), where the usize is an incrementing number kept in the StmtCache, then the scan could happen only on eviction, rather than on every lookup.
The text was updated successfully, but these errors were encountered:
jonhoo
added a commit
to jonhoo/rust-mysql-simple
that referenced
this issue
Feb 9, 2018
The
StmtCache
currently does a linear probe of theorder
vector (including a string comparison for each position) every time it looks up a query. This is fine if the statement cache is fairly small, or a small set of queries are very common, but if it is larger, this scan + remove + push can become quite costly. From what I can tell, it is only used for keeping an LRU of the items in theHashMap
. If the values in the map were instead, say,(usize, InnerStmt)
, where theusize
is an incrementing number kept in theStmtCache
, then the scan could happen only on eviction, rather than on every lookup.The text was updated successfully, but these errors were encountered: