So they use gcc and clang idioms when possible. I believe the main reason is that the main part developers has primary target unixes and so target to gcc or clang. I believe other specialties of gcc are also used which also could make difference. It might be that Microsoft compiler don't support computed goto which can make a huge difference in an interpreter. A bit surprising if a Microsoft compiler is that much slower, I would have expected only a marginal difference. Just a guess: it is compiled with gcc, which is very good at optimizing code. See if you can generate flamegraphs of the two and see where things are slower in the Windows version. () sounds like the right place to start, and _probably_ it's capable of tracing WSL processes. I think you'd need to find some sort of profiling tool to get a real answer. It's entirely possible that the glibc memory allocator is algorithmically faster or just more efficient (talks to the OS less often and maintains a larger pool of memory) than the Windows one. This includes what UNIX people would call the C library, which includes things like memory allocation. One thing that's worth noting is that WSL is a _subsystem_, just like Win32 is a subsystem: you're actually bypassing parts of normal Windows, and using just the underlying NT kernel + the Linux interface on top of it, instead of the usual Win32 interface. The WSL python was compiled by me as there is no Python 2.7.13 in APT yet. WSL python binary: 299 065 pystones/second Native python.exe: 200 410 pystones/second So the compiler optimisation gain is more than the overhead for running a VM.Īdded some formatting, but the important part is: I noticed that Ubuntu's build by Ubuntu is faster in an Ubuntu VM on a Mac, then native Mac build from psf. I can't read your post due to formatting so I can't tell what your running, so probably an optimised build. I don't think psf builds from the website have all the optimisations on in case of edge case bugs. See for a table matching Visual Studio versions to Python versions. Try again with Python 3.6, that uses a much more recent version of MSVC. Title: Why is Python 50% faster under Windows Subsystem for Linux?, ups: 152, downs: 0, Have we visited?: False
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |