Author erlendaasland
Recipients berker.peksag, erlendaasland, serhiy.storchaka
Date 2021-01-08.00:39:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Pro: less code, less complexity, improved maintainability
Con: minor performance hit

PoC here:

$ ./python.exe
>>> import sqlite3
>>> con = sqlite3.connect(":memory:")
>>> con.execute("select * from sqlite_master")
>>> con.execute("select * from sqlite_master")
>>> c = con.cache()
>>> c.cache_info()
CacheInfo(hits=1, misses=1, maxsize=128, currsize=1)

The test suite runs approx. 10-20 ms slower with this change. Using _functools._lru_cache_wrapper iso. functools.lru_cache almost removes this performance regression.

Berker, is it worth pursuing?
Date User Action Args
2021-01-08 00:39:03erlendaaslandsetrecipients: + erlendaasland, berker.peksag, serhiy.storchaka
2021-01-08 00:39:03erlendaaslandsetmessageid: <>
2021-01-08 00:39:03erlendaaslandlinkissue42862 messages
2021-01-08 00:39:03erlendaaslandcreate