commit 7acc57e00cc63753ecb4bde49a4fb251e6397a11
parent ca87160007aa904949a9e22b29c57f81e8672a15
Author: Eamon Caddigan <eamon.caddigan@gmail.com>
Date: Sun, 23 Mar 2025 20:59:50 -0700
Add weeknote for 2025-W13
Diffstat:
1 file changed, 58 insertions(+), 0 deletions(-)
diff --git a/content/posts/weeknotes/2025-w13/index.md b/content/posts/weeknotes/2025-w13/index.md
@@ -0,0 +1,58 @@
+---
+title: "Weeknote for 2025-W13"
+description: ""
+date: 2025-03-24T08:59:00-07:00
+draft: false
+categories:
+- Weeknotes
+tags:
+- Python
+- R
+---
+
+## Multiprocessing in Python is pretty broken
+
+A common scenario: you have some code Python that's taking too long. But the
+algorithm is embarrassingly parallel and your computer has all these cores, so
+maybe you can speed it up by using them all. So you spend a day refactoring
+things to use `multiprocessing`, and... it doesn't help at all.
+Congratulations, you just got bitten by the
+[GIL](https://wiki.python.org/moin/GlobalInterpreterLock). This post ([H/T
+Brandon Rohrer](https://recsys.social/@brohrer/114180565217926164)) goes into
+the issue and talks about some workarounds.
+
+[Itamar Turner-Trauring --- Python’s multiprocessing performance
+problem](https://pythonspeed.com/articles/faster-multiprocessing-pickle/)
+
+## A bookmarklet to download web fonts
+
+Whenever you see a cool typeface on the web, that usually because the site has
+sent a whole a web font to your browser. What if you wanted to keep that file
+for... other uses? This bookmarklet helps you do just that.
+
+[Immoral Web Font Vacuum](https://smallandnearlysilent.com/immoral/)
+
+## Suppressing lintr false positives when using targets
+
+I'm [still experimenting with LazyVim]({{< ref
+"posts/weeknotes/2025-w10/#trying-lazyvim" >}}), and among its other slick
+features, I get suggestions from [lintr](https://lintr.r-lib.org/) right in my
+editor window as I write R code. I'm a big fan of the
+[targets](https://books.ropensci.org/targets/) workflow, but using lintr with
+scripts that will be run from targets generates false-positive lints, citing
+"no visible global function definition" for the functions that are imported
+from other packages. This happens because the functions are run in an
+environment with all the appropriate packages attached, but the scripts
+themselves don't load them with a call to `library()`. It would be ideal to be
+able to suppress this specific check when writing targets code, but for now I'm
+suppressing the error with a `.lintr` file in the root of each project that
+contains only the following:
+
+```r
+linters: linters_with_defaults(
+ object_usage_linter = NULL
+ )
+```
+
+This didn't feel worthy of a whole blog post, but I wanted to share this
+workaround more broadly!