• 58 Posts
  • 1.09K Comments
Joined 2 年前
cake
Cake day: 2023年7月30日

help-circle





  • TLDR: 3.11 is twice as fast as 3.10 at doing global name lookups, so an old speedup hack of aliasing a global function locally isn’t needed.

    For example, when calling len() in a loop, going l=len, and calling l() in the loop was faster in 3.10. In 3.11, moreso in 3.13, it’s almost a wash.

    However, the author says this:

    Accessing functions through a module [e.g. math.sin()] or a deep attribute chain can still carry overhead. Creating a local alias or using “from module import name” continues to be effective in those situations.

    But when I look at the numbers, I would say 3.13 is pretty close to making it an unnecessary optimization in general. A little subjective on how you interpret the numbers.

    Great info, but this was like trying to use a recipe and reading the author’s life story to get there.













  • Trade watchers have always suspected Canada was holding on to the DST mainly for negotiating purposes. It was something generally positive for Canada that could nonetheless plausibly be negotiated away for some meaningful purpose, perhaps in the planned six-year review of the Canada-U.S.-Mexico Agreement (CUSMA) that replaced NAFTA under the first Trump presidency. Prime Minister Carney admitted this was the plan in a press scrum today (June 30).

    I’m really hoping they played this card right. It doesn’t feel like they did, but I hope Carney is playing on a level we don’t get.