Skip to content

gh-144319: obtain SeLockMemoryPrivilege on Windows#144928

Open
chris-eibl wants to merge 1 commit intopython:mainfrom
chris-eibl:huge_pages_windows
Open

gh-144319: obtain SeLockMemoryPrivilege on Windows#144928
chris-eibl wants to merge 1 commit intopython:mainfrom
chris-eibl:huge_pages_windows

Conversation

@chris-eibl
Copy link
Member

@chris-eibl chris-eibl commented Feb 17, 2026

Obtain SeLockMemoryPrivilege on startup on Windows to be able to use large pages when requested by setting the environment variable PYTHON_PYMALLOC_HUGEPAGES.

I've decided to fail if that doesn't succeed instead of silently switching to normal 4K pages and updated the documentation.

Using bench_obmalloc.py from the issue I get

Benchmark Default Hugepages Change
arena_pressure 0.717s 0.477 -33.5%
mixed_sizes 0.213s 0.156 -27.0%
list_of_tuples 2.417s 1.876 -22.4%
class_instances 0.224s 0.180 -19.6%
fragmentation 0.250s 0.204 -18.1%
bulk_small_alloc 0.324s 0.266 -18.0%
random_walk 1.364s 1.161 -14.8%
dict_churn 0.123s 0.122 -1.1%

for an AMD64 VS2026 release build (no PGO) on my PC (Haswell i5-4570, Windows 10).


📚 Documentation preview 📚: https://cpython-previews--144928.org.readthedocs.build/

@chris-eibl
Copy link
Member Author

Skipping news because that's already covered by @pablogsal 's previous PRs.

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.

1 participant