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
Rats are nocturnal and shy creatures that prefer to stay in small and dark spaces, making it challenging to track them down.
Apart from conducting rat surveillance at publicly accessible places islandwide, #NEAofficers also carry out risk-based checks at various known hotspots.
Check out the different types of equipment used to overcome challenges faced during inspections, and learn more here: https://fb.watch/laCn_dEdrY/
3 local cases of Zika virus infection have been confirmed in the Kovan area in the past month. Vector control operations have commenced in the vicinity.
As our #NEAofficers are conducting inspections and indoor spraying of insecticides, we urge residents to cooperate with them. Besides eliminating mosquito breeding habitats, those residing at Zika and dengue cluster areas should carry out ‘S-A-W’ actions:
- Spray insecticide in dark corners around the house
- Apply insect repellent regularly
- Wear long-sleeve tops & long pants
go.gov.sg/nea-zika-12may2023
Happy Labour Day!
Here’s a huge THANK YOU to all who are working hard to keep our nation running.
A special shout-out too to thank our cleaners for keeping our city clean and green, our hawkers for working tirelessly to provide delicious hawker fare, as well as #NEAofficers for ensuring a clean and sustainable environment.
#NEAOfficers like Sulaiman work with these waste collectors to ensure biohazardous waste will be collected and incinerated quickly, in a way that is safe for waste handlers and the environment during the COVID-19 period. Find out what he does on our Instagram story highlight at www.instagram.com/nea_sg!
#NEAOfficers prepared a surprise for our hawkers last week! 14,000 care packages will be distributed to our hawkers who have been working tirelessly so that we can continue to enjoy our favourite hawker food.
https://youtu.be/T_ArJhAOAHA
Beware litterbugs - your poorly discarded items could become the stink of the neighbourhood! Let’s avoid attracting unwanted smells and pests, by properly binning our rubbish. Together, we can #KeepSGClean!
Our #NEAofficers have been working hard to apprehend high-rise littering offenders, using data analytics to prioritise camera deployment. As high-rise littering cases are usually harder to detect, they may take some time to be resolved.
If you witness such incidents, do take note of specific details such as date, time and precise location (block stack or column), and include them when submitting feedback (www.nea.gov.sg/feedback), to help with our investigation.
#DidYouKnow that there are 3 main rat species found in Singapore? From roof rat to sewer rat to house mouse, find out how our #NEAofficers carry out rat surveillance and look for signs of rat activity during their inspections, and get useful tips on rat prevention measures: https://fb.watch/laCn_dEdrY/
#SGDengueUpdate Over 2,700 dengue cases have been reported in 2021. Increasing Aedes aegypti mosquito population, and higher circulation of less common Dengue virus serotypes 3 and 4 to which we have lower population immunity, contribute to higher risk of dengue transmission. While our #NEAOfficers continue to conduct targeted inspections at areas with higher mosquito population, and step up operations at dengue cluster areas, residents should do the #MozzieWipeout regularly to #BLOCKDengue. https://go.gov.sg/nea-dengue-1jun2021
Where there are wet and dark crevices, NEA’s Dengue Inspection Officer Marthandan will be there. Let him show you how he and his team spot and tackle mosquito breeding in the areas around you!
Join him in our #NEAOfficers Story Highlight on our Instagram profile (www.instagram.com/nea_sg)!
#SGUnited#SGTogether
Whenever NEA receives feedback on noise or smell nuisance, #NEAofficers such as Joey would investigate the root cause and try to resolve the issues for residents. Read on to find out more about his winning formula: https://www.facebook.com/NEASingapore/posts/324902236450865
#PeopleofNEA#NEA20
#InNEAvation#DidYouKnow the COVID-19 virus can be detected in human stools? Read about the novel wastewater surveillance method initiated by #NEAScientists early last year. https://go.gov.sg/wastewatersurveillancepaper
#FightCOVID19#NEAOfficers