You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/10/29 22:19:11 UTC

[GitHub] [airflow] mjpieters commented on a change in pull request #11957: Cache CLI parser objects

mjpieters commented on a change in pull request #11957:
URL: https://github.com/apache/airflow/pull/11957#discussion_r514599968



##########
File path: airflow/cli/cli_parser.py
##########
@@ -1457,6 +1458,7 @@ def _format_action(self, action: Action):
         return super()._format_action(action)
 
 
+@lru_cache(maxsize=2)

Review comment:
       There is no point in giving this a max size here. There are two possible cache keys: True or False, so the cache is already bounded. But by setting maxsize to 2 the LRU cache decorator will lock and test the cache size every call, and that's just unnecessary.
   
   If you use `maxsize=None` no locking is needed and cache lookups are that little bit faster.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org