6 ms·
The money shot (wish this were included in the blog post): # if defined(_MSC_VER) && !defined(__clang__) # define Py_MUSTTAIL [[msvc::musttail]] #
by mananaysiempre 10mo ago
The money shot (wish this were included in the blog post):
# if defined(_MSC_VER) && !defined(__clang__)
# define Py_MUSTTAIL [[msvc::musttail]]
# define Py_PRESERVE_NONE_CC __preserve_none
# else
# define Py_MUSTTAIL __attribute__((musttail))
# define Py_PRESERVE_NONE_CC __attribute__((preserve_none))
# endif
https://github.com/python/cpython/pull/143068/files#diff-45baf725df91ed7826458cda8a17c2b4a2e5296504de1ed6a1c5a9ebe6390a47 https://github.com/python/cpython/pull/143068/files#diff-45b...
Apparently(?) this also needs to be attached to the function declarator and does not work as a function specifier: `static void *__preserve_none slowpath();` and not `__preserve_none static void *slowpath();` (unlike GCC attribute syntax, which tends to be fairly gung-ho about this sort of thing, sometimes with confusing results).
Yay to getting undocumented MSVC features disclosed if Microsoft thinks you’re important enough :/
- deleted 10mo ago[deleted]
- publicdebates 10mo agoImportant enough, or benefits them directly? I have no good guesses how improving Python's performance would benefit them, but I would guess that's the real reason.
- HPsquared 10mo agoI wonder if this is related to Python in Excel. You'll have lots of people running numerical stuff written in Python, running on Microsoft servers.
- mkoubaa 10mo agoA lot of commercial engineering and scientific software runs on windows.
- andix 10mo agoI guess there are some Python workloads on Azure, Microsoft provides a lot of data analysis and LLM tools as a service (not paid by CPU minutes). Saving CPU cycles there directly translates to financial savings.
- acdha 10mo agoThink about how much effort they have put into things like Pylance and general python support in VAC. Clearly they think they have enough users that this matters to that a first class experience is worth having.
- pjmlp 10mo agoMicrosoft was the one hiring Guido out of retirement, and alongside Facebook finally kicking off the CPython JIT efforts. Python is one of the Microsoft blessed languages on their devblogs.
- throw1ahs 10mo agoThe project was first suggested by Mark Shannon. Van Rossum inserted himself into the project. Faster CPython people have been fired by Microsoft last year. Generally not that much has happened in 5 years, sometimes 10-15% improvements are posted that are later offset by bloat. I think the project started in 3.10, so 3.9 is the last version to compare to. The improvements aren't that great, I don't think any other language would get so much positive feedback for so little.
- pjmlp 10mo agoI know what happened last year, my point was the prior history that lead to that effort. https://thenewstack.io/guido-van-rossums-ambitious-plans-for-improving-python-performance https://thenewstack.io/guido-van-rossums-ambitious-plans-for... Agree with the sentiment, Python is the only dynamic language where it seems a graveyard from efforts. And nope it isn't the dynamism per se, Smalltalk, Self, Common Lisp are just as dynamic, with lots of possibilities to reboot the world and mess up JIT efforts, as any change impacts the whole image. Naturally those don't have internals exposed to C where anything goes, and the culture C libraries are seen as the language libraries.
- boulos 10mo agoEhh, PHP fits that bill and is clearly optimizable. All sorts of things worked well for PHP, including the original HipHop, HHVM, my own work, and the mainline PHP runtime. Python has some semantics and behaviors that are particularly hostile to optimization, but as the Faster Python and related efforts have suggested, the main challenge is full compatibility including extensions plus the historical desire for a simple implementation within CPython. There are limits to retrofitting truly high performance to any of these languages. You want enough static, optional, or gradual typing to make it fast enough in the common case. That's why you also saw the V8 folks give up and make Dart, the Facebook ones made Hack, etc. It's telling that none of those gained truly broad adoption though. Performance isn't all that matters, especially once you have an established codebase and ecosystem.
- monster_truck 10mo ago[flagged]
- furyofantares 10mo agoThat's not where the term comes from https://en.wikipedia.org/wiki/Money_shot https://en.wikipedia.org/wiki/Money_shot
- abacuss 10mo agoI don't understand why your mind went immediately to pornography. Kind of creepy tbh.
- ambicapter 10mo agoYou're overreacting, see the wikipedia article posted above. > By 1977[2][3] the phrase had entered American usage as slang for the cum shot in a pornographic film https://en.wikipedia.org/wiki/Money_shot https://en.wikipedia.org/wiki/Money_shot
- deleted 10mo ago[deleted]
- UqWBcuFx6NV4r 10mo agoSigh. Lately I’ve been seeing kids doing this sort of overly-sensitive, bad-intentioned, dishonest pearl-clutching as a weird form of rebellion. This reply has all the linguistic hallmarks of it. Please don’t bring this stuff to HN. It’s ridiculous, and it’s tiring. Nobody is being creepy. Stop trying to stir the pot.
- monster_truck 10mo agoYou must not have ever done any work in communications or PR, it's extremely off limits for a reason.
- CharlesW 10mo agoThis is why they want to replace us with AI.
- kenjin4096 10mo agoSo it seems I was wrong, [[msvc::musttail]] is documented! I will update the blog post to reflect that. https://news.ycombinator.com/item?id=46385526 https://news.ycombinator.com/item?id=46385526
- MangoToupe 10mo ago[flagged]