7.09.2025 состоялся релизPithon 3.14!
На фоне хайпа про NoGIL всё позабыли про другие фичи. Особенно про Multiple Interpreters, который обещает изоляцию процессов но с эффективностью потоков! На сколько действительно это будет эффективно мы узнаем позже, потому что сейчас это лишь первый релиз с ограничениями и недоработками.
Но что там про NoGIL? Теперь этот режим не экспериментальный, а официально поддерживаемый, но опциональный.
Чтобы запустить без GIL нужна специальная сборка. И перед стартом нужно объявить переменную PYTHON_GIL=0
Для вас я собрал готовый репозиторий где достаточно запустить скрпит, который всё сделает:
▫️ соберет релизный Python 3.14 в новый Docker-образ
▫️ запустит тесты в контейнере (GIL, NoGIL, MultiInterpreter)
▫️ распечатает результаты
Тест очень простой, усложняйте сами)
Вот какие результаты у меня:
=== Running ThreadPoolExecutor GIL ON
TOTAL TIME: 45.48 seconds
=== Running ThreadPoolExecutor GIL OFF
TOTAL TIME: 6.14 seconds
=== Running basic Thread GIL ON
TOTAL TIME: 45.54 seconds
=== Running basic Thread GIL OFF
TOTAL TIME: 4.74 seconds
=== Running with Multi Interpreter
TOTAL TIME: 18.30 seconds
Если сравнивать GIL и NoGIL, то на мои 32 ядра прирост х7-x10 (почему не х32? 🤷). При этом нам обещают что скорости будут расти с новыми релизами.
Режим без GIL похож (визуально) на async, тоже параллельно, тоже не по порядку. Но это не IO! и от того некоторый диссонанс в голове 😵💫, нас учили не так!
Интересно, что чистый Thread работает быстрей чем ThreadPoolExecutor без GIL.
Ну и где-то плачет один адепт мульти-интерпретаторов😭 Теперь нужно искать где они могут пригодиться с такой-то скоростью. Скорее всего своя область применения найдется.
Отдельно я затестил память и вот что вышло на 32 потока:
ThreadPoolExecutor GIL ON
305.228 MB
ThreadPoolExecutor GIL OFF
500.176 MB
basic Thread GIL ON
90.668 MB
basic Thread GIL OFF
472.444 MB
with Multi Interpreter
1267.788 MB
Пока не знаю как к этому относиться)
В целом - радует направление развития!
#release
🌎 Some octopus species, like the mimic octopus, can rapidly change their color and skin texture to blend into diverse backgrounds or imitate venomous sea creatures. This camouflage is controlled by specialized skin cells called chromatophores, iridophores, and leucophores, allowing them to avoid predators or catch prey. ✨
#animals⚡#camouflage⚡#ocean
👉subscribe Interesting Planet
👉more Channels
🌎 Parrotfish dazzle reefs with scales in neon blues, pinks, and greens, while the stonefish hides perfectly among rocks thanks to its bumpy, mottled skin. Stonefish toxins can cause serious injury if stepped on. ✨
#animals⚡#camouflage⚡#ocean
👉subscribe Interesting Planet
👉more Channels
🌎 The peacock mantis shrimp stands out for its dazzling rainbow armor and lightning-fast punch. Its eyes detect polarized and multispectral light far beyond human vision. This shrimp's punch can shatter aquarium glass and accelerate as fast as a bullet—up to 23 meters per second. ✨
#animals⚡#camouflage⚡#ocean
👉subscribe Interesting Planet
👉more Channels
🌎 Few animals rival the peacock mantis shrimp for color and camouflage. Its shell displays vivid blues, reds, and greens, helping it blend with coral while startling predators. The mantis shrimp’s eyes detect polarized light and twelve color channels—far more than humans, who see only three. ✨
#animals⚡#camouflage⚡#ocean
👉subscribe Interesting Planet
👉more Channels
🌎 Arctic hares survive the icy tundra by changing their fur color—white in winter to blend with snow, brown or gray in summer for camouflage. Adults can leap up to 2 meters in a single bound to escape predators. ✨
#animals⚡#adaptation⚡#camouflage
👉subscribe Interesting Planet
👉more Channels
🌎 Harlequin toads flaunt striking black, yellow, and orange patterns to warn predators of their skin toxins, while the common leaf insect mimics green leaves so closely that even its legs resemble plant veins. Scientists have documented over 3,000 species of leaf-mimicking insects worldwide. ✨
#animals⚡#adaptation⚡#camouflage
👉subscribe Interesting Planet
👉more Channels
🌎 The leafy sea dragon, native to southern Australia, blends perfectly with seaweed thanks to leaf-like extensions on its body. These fins don’t propel it but provide camouflage from predators. Leafy sea dragons reach up to 35 centimeters in length and are closely related to seahorses. ✨
#adaptation⚡#camouflage⚡#ocean
👉subscribe Interesting Planet
👉more Channels
🌎 The orchid mantis of Southeast Asia blends in with flowers thanks to petal-shaped limbs and white, pink, or yellow coloring that matches local orchids. This insect both camouflages from predators and attracts pollinators, which it ambushes for food. ✨
#animals⚡#camouflage⚡#insects
👉subscribe Interesting Planet
👉more Channels
🌎 The Indian leaf butterfly disguises itself as a dead leaf when at rest, with veins and brown patterns mimicking real foliage. When disturbed, it reveals bright blue and orange wings underneath—stunning colors that help startle predators. This butterfly is native to forests in South and Southeast Asia. ✨
#camouflage⚡#adaptation⚡#insects
👉subscribe Interesting Planet
👉more Channels
🌎 The mimicry leaf insect looks exactly like a real leaf, down to brown spots that resemble decay. This remarkable disguise protects it from hungry predators by blending perfectly into the forest floor. ✨
#insects⚡#camouflage⚡#adaptation
👉subscribe Interesting Planet
🌎 Peacock spiders from Australia show off bold, iridescent colors during their unique courtship dances. Males raise flaps on their abdomen that resemble tiny rainbows to attract females. Over 80 species have been identified, each with distinct colors and patterns. ✨
#animals⚡#camouflage⚡#spiders
👉subscribe Interesting Planet
🌎 In Madagascar, the leaf-tailed gecko uses its flattened body and jagged skin edges to blend perfectly with tree bark, becoming nearly invisible to predators. This camouflage is so advanced that even experienced biologists often miss spotting them during the day. ✨
#reptiles⚡#camouflage⚡#Madagascar
👉subscribe Interesting Planet