4 ms·
If you can't share memory between threads you can't write high performance programs. If you have a global interpreter lock you can't write high performance prog
by gizmo 2y ago
If you can't share memory between threads you can't write high performance programs. If you have a global interpreter lock you can't write high performance programs. If your threads can only communicate through channels or IPC you can't have high performance programs.
Languages can't pack your data effectively unless you tell the compiler what data types to use. Array<u8> or Array<s32>? Should ints overflow or not? Unless the programmer specifies what should happen the compiler might pick a data type that is 4x larger than necessary.
Despite all the effort put into javascript engines in the past decades the fastest JS code is cross-compiled C code. Quake II runs perfectly in the browser and it's 140k lines of C. But you can't make games of similar complexity in regular Javascript because the browser would completely choke on it.
- marcosdumay 2y agoYou don't need to share the global symbol table to share memory.
- anamax 2y ago> If you can't share memory between threads you can't write high performance programs. I don't know whether shared memory is required for high-performance programs but I do know that python THREADS can share memory. The GIL means that only one thread is executing bytecodes at a time. That's it. It doesn't place any other restriction on python programs. I write crypto trading code in python. It takes 0.1ms from the time I receive a packet until the time I send the packet containing the trade based on receiving that packet. Yes, that 0.1ms includes the logic to decide whether to trade. FWIW, that chain of processing happens to involve two threads that share memory.
- jrvieira 2y ago0.1ms is hundreds of thousands of instructions on a modern phone...