Originally posted by NobodyXu
View Post
Announcement
Collapse
No announcement yet.
Python 3.11 Performance Benchmarks Show Huge Improvement
Collapse
X
-
- Likes 1
-
Originally posted by sinepgib View Post
Python already has mutex and rwlock in its standard library IIRC. That's because the GIL only prevents races at the individual opcode level, not complex objects.
Leave a comment:
-
Originally posted by NobodyXu View PostI was mainly thinking about locking.
IMHO if GIL is removed, then having some language construct for locking might be desired, probably because I come from compiled PL like Rust and is used to explicitly add locking.
I have not looked too much into IronPython or Jython, though I do hear that they do not have a GIL due to different API and JIT.
Leave a comment:
-
Originally posted by atomsymbol[*]Because neither compile() nor eval() are in the C/C++ standards, it is possible that a high-performance 8-bit emulator could run faster in plain CPython than in plain C/C++. The term "plain C/C++" means that the main part of the emulator isn't using non-standard C/C++ features (such as: libgccjit.so).
You can write a C/C++/Rust interpreter or a JIT compiler that compiles C/C++/Rust to some internal bitcode or to native code and run them anyway.
The "compile()" function in python also calls into the python interpreter written in C, it's not written in Python.
Leave a comment:
-
Originally posted by atomsymbol
It isn't necessary because it is possible to search the space for near-optimal solutions without human intervention during the search.
A trivial example would be the CPython interpreter itself.
Since it accepts almost all valid python code and is written in C, an AOT pl, it can be considered as a C program that takes file "*.py" as data.
Since python is interpreted by the C program, anything can be done by the python must be able to be done by C.
Leave a comment:
-
Originally posted by atomsymbol[*]Because neither compile() nor eval() are in the C/C++ standards, it is possible that a high-performance 8-bit emulator could run faster in plain CPython than in plain C/C++. The term "plain C/C++" means that the main part of the emulator isn't using non-standard C/C++ features (such as: libgccjit.so).
Leave a comment:
-
Originally posted by sinepgib View PostNone of those are visible to pure Python code. In fact, aren't some of the alternative interpreters GIL-less? I may be confused, but I think IronPython or Jython don't have a GIL, and pure Python is supposed to run fine. Maybe we mean different things with "language construct"? I interpret a syntax/semantic change at the Python language level (i.e., I'm not counting changes to native extensions, those will surely break and are not always compatible between implementations).
IMHO if GIL is removed, then having some language construct for locking might be desired, probably because I come from compiled PL like Rust and is used to explicitly add locking.
I have not looked too much into IronPython or Jython, though I do hear that they do not have a GIL due to different API and JIT.
Leave a comment:
-
Originally posted by NobodyXu View PostYeah you are right.
Removing the GIL would certainly break the C API, reference counting/change to GC and requires to add lock somehow, thus probably requires new language construct.
Leave a comment:
-
Originally posted by atomsymbolIf you implement an emulator of an 8-bit machine (such as: Atari 130XE) and compile the emulator using an AOT compiler, then it is mathematically impossible for the AOT compiler to account for the fact that you loaded a a particular game (such as: Bruce Lee) into the 8-bit emulator, especially if it is a game that was developed after the file "Atari130XE.exe" was created by the AOT compiler. ---- If the emulator was implemented in Python (or some other language capable of compiling and loading arbitrary code at run-time) then the emulator could translate selected parts of the currently loaded 8-bit machine-code directly into Python bytecode.
Which means that you already put the information into the program before it even starts running.
Then, what's the problem with doing the same thing with AOT program?
You already put the information into the python program prior to running it, you can absolutely do the same thing in AOT program.
You see, AOT is not inferior to dynamic language, the later does not give you more advantages when it comes to such optimization or the general ease-of-use since every case would still needs to be coded AOT before the program is up and running.
Leave a comment:
-
Originally posted by sinepgib View PostYes, it's not there by accident after all. Regarding requirements, I don't think it requires JIT nor changing the high level part of the language. It will probably require breaking the C API to some degree, and it will either require more sophisticated techniques for reference counting, a hit for simply taking locks or promoting the GC to be the only memory management mechanism.
Removing the GIL would certainly break the C API, reference counting/change to GC and requires to add lock somehow, thus probably requires new language construct.
Leave a comment:
Leave a comment: