storage.database.mysqldb: Optimise getObject for most likely case.
loadBefore is more likely than other loads, as it is how repeatable-read is implemented and the vast majority of accesses are scoped to a transaction. So put it first in 3-branches "if" choosing between load/loadBefore/loadSerial code paths. next_serial is likely to not be found, because application will likely operate on up-to-date objects. So a test is more efficient than a try..except. Inline this test in return statement to avoid defining a local.
Showing
Please register or sign in to comment