SQLCatalog: Optimise and simplify transactional_cache_decorator.
Auto-generate cache_id, removing the risk of duplicating one. Inline getInstanceID as it is its only caller left. Avoid wrapping if getTransactionalVariable cannot be imported. Avoid intermediate variables, at the cost of dupicating logic but accelerating run-time. Use functools.wraps . Access _cache_sequence_number directly - these pieces of code are friends anyway, we already set a volatile property on Catalog instance. Saves one getattr and one call.
Showing
Please register or sign in to comment