mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
Calls to `render_markdown_path` weren't getting cached since the context argument is unhashable, and the `ignore_unhashable_lru_cache` decorator ignores such calls. This commit adds a couple of more decorators - one which converts dict arguments to the function to a dict items tuple, and another which converts dict items tuple arguments back to dicts. These two decorators used along with the `ignore_unhashable_lru_cache` decorator ensure that the calls to `render_markdown_path` with the context dict argument are also cached. The time to run zerver.tests.test_urls.PublicURLTest.test_public_urls drops by about 50% from 8.4s to 4.1s with this commit. The time to run zerver.tests.test_docs.DocPageTest.test_doc_endpoints drops by about 20% from 3.2s to 2.5s.
22 KiB
22 KiB