Skip to content

Conversation

@corona10
Copy link
Member

@corona10 corona10 commented Nov 29, 2025

@corona10
Copy link
Member Author

corona10 commented Nov 29, 2025

Annotation

Screenshot 2025-11-29 at 6 10 03 PM

Without annotation

Screenshot 2025-11-29 at 6 23 31 PM

I verified that this annotation actually works, and I believe it will be very helpful for debugging when needed.

@corona10
Copy link
Member Author

cc @picnixz

@corona10
Copy link
Member Author

FYI, Fedora does not support yet even if the kernel version itself already support it.
See: https://bugzilla.redhat.com/show_bug.cgi?id=2302746

cc @vstinner @encukou

corona10 and others added 3 commits November 29, 2025 09:30
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@corona10 corona10 requested a review from picnixz November 29, 2025 10:13
@SpecLad
Copy link
Contributor

SpecLad commented Nov 29, 2025

FWIW, it would be useful to have an option to enable this in release builds too.

@corona10
Copy link
Member Author

@SpecLad Thanks for the feedback, I will create a separate PR :)

@corona10
Copy link
Member Author

@SpecLad Just out of curiosity, passing the build flag through ./configure --enable-annotate-mmap would be fine to you?
I would like to follow Ruby's approach but disable this flag by default unless many disto actually want this flag.

@SpecLad
Copy link
Contributor

SpecLad commented Nov 29, 2025

To be clear, by "option" I really mean a runtime option. 🙂 It would be pretty annoying to have to rebuild Python just for this. If you compare with other implementations, none of them require a compile-time option:

  • C (glibc) - off by default, can be enabled with environment variable;
  • Go - on by default, can be disabled with environment variable;
  • Ruby - on permanently (unless I missed something).

TBH, I don't see why Python shouldn't also permanently enable this, but I would settle for "off by default, enabled with environment variable or -X option".

@picnixz
Copy link
Member

picnixz commented Nov 29, 2025

It's a bit annoying that this would only be supported on Linux. Do we have an option that isn't supported everywhere?

@corona10
Copy link
Member Author

corona10 commented Nov 29, 2025

@SpecLad Let’s move this forward conservatively for 3.15, and we can consider making it the default in the future. A runtime check would introduce an overall performance regression.
I still prefer the Ruby approach, since Ruby is also an interpreter like Python. But I do think enabling this by default later on is the right direction.

If some distros want to use this feature, they will enable it through a build flag, and it always happens.

@corona10
Copy link
Member Author

It's a bit annoying that this would only be supported on Linux. Do we have an option that isn't supported everywhere?

Looks not and I belive that this is off-topic. :)

@picnixz
Copy link
Member

picnixz commented Nov 29, 2025

My point was: I prefer not having an -X option that is platform dependent and rather have an environment variable (we have PYTHONCASEOK actually as a Windows-only environment variable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants