{"html_url": "https://github.com/simonw/datasette/pull/2056#issuecomment-1506485287", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2056", "id": 1506485287, "node_id": "IC_kwDOBm6k_c5ZyyQn", "user": {"value": 3709715, "label": "cclauss"}, "created_at": "2023-04-13T07:29:38Z", "updated_at": "2023-04-13T07:41:55Z", "author_association": "NONE", "body": "Ruff (written in Rust, not Python) is a 23MB executable so the time to download and pip install it dwarfs its runtime.\r\n\r\nLet's run ruff with and without GitHub Actions pip cache side-by-side to see the relative performance.\r\n\r\nOnce you approve the workflows below, `ruff_with_cache` should echo `cache-hit = false` but if you rerun that job hopefully it should echo `cache-hit = true`. That will be the execution time that we are interested to compare.\r\n\r\nThere are two great problems in computer science: ;-)\r\n1. Naming things\r\n2. Cache invalidation\r\n3. Off-by-one errors\r\n\r\nFor 2., https://github.com/actions/setup-python#caching-packages-dependencies is vital reading.\r\nOnly _exactly pinned requirements_ can be cached. Currently in `setup.py` the only pinned dependencies are:\r\n1. Sphinx==6.1.3\r\n2. furo==2023.3.27\r\n3. black==23.3.0\r\n4. blacken-docs==1.13.0 # but unpinned elsewhere in `setup.py`\r\n\r\nThis means that there will be very few cache hits in the current actions. See the link below to print out cache hits:\r\nhttps://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#cache-hit\r\n\r\n> PyPI uses Fastly's CDN to quickly serve content to end-users, allowing us to minimize our hosting infrastructure and obscure possible downtime. -- https://pypi.org/sponsors\r\n\r\nI would be shocked if Fastly does not have beefy CDN nodes in the same datacenters where GitHub Actions run so GHA requests to download `ruff` probably never hit a PyPI server.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1661860507, "label": "GitHub Action to lint Python code with ruff"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2056#issuecomment-1509852821", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2056", "id": 1509852821, "node_id": "IC_kwDOBm6k_c5Z_oaV", "user": {"value": 3709715, "label": "cclauss"}, "created_at": "2023-04-15T14:24:45Z", "updated_at": "2023-04-15T14:24:45Z", "author_association": "NONE", "body": "Status?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1661860507, "label": "GitHub Action to lint Python code with ruff"}, "performed_via_github_app": null}