TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #32 · 7 фев.

Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks

Резултати

Пронајдени 5 слични објави

Пребарај: #biolabs

当前筛选 #biolabs清除筛选
Dr Sherri Tenpenny

@SherriTenpenny · Post #24219 · 17.02.2026 г., 17:43

🚨New Post Alert - Check out this article by contributing author FedUpTexasChick ‘A Succinct History of The US Bioweapons Program’ https://thetenpennyreport.com/succinct-history-us-bioweapons/ #biolabs#bioweapons 🔹👉🏻@SherriTenpenny

BadVolf

@BadvolfNews · Post #407 · 20.10.2022 г., 11:23

Not satisfied with US attempts to obfuscate legitimate questions about the nature of its #biolabs activities in #Ukraine, the Russian Federation and its allies at the #UN request that the #UNSC be seized of the matter.

BadVolf

@BadvolfNews · Post #782 · 08.08.2023 г., 08:50

🔍 Repercussions are felt across the #US, with #China-linked bio-lab, Universal Meditech Inc., found operating on American soil amidst a cloud of controversy and risk. Producing and modifying dangerous pathogens, the lab exposes a chilling side of international politics. Meanwhile, thousands of miles away in #Ukraine, the US-funded Biological Threat Reduction Program mirrors a similar narrative, causing a wave of diseases such as H1N1 and measles. The alleged cover-up led by seasoned diplomat, Victoria Nuland, underscores the controversy. ❓The paradox is striking. Why does a Chinese bio-lab on home soil spark national outrage, while many similar US labs abroad, working with far more dangerous pathogens and linked with disease outbreaks, are dismissed? 💰 Chinese influence is complete in the US through hefty monetary transactions, approximating $10 million, to the Biden family. Coupled with the Democrats' cover-up of the Covid-19 origins, the situation reeks of possible collusion. 🌏 As we navigate this biological warfare, it's clear that transparency, accountability, and consistent standards are non-negotiable. The stakes have never been higher. Soon I will release a new book covering the lies and disinformation people have been fed about the war in Ukraine. There will be several chapters on US involvement in biological warfare research in Ukraine, information you've never heard about, back up with real documentation. You are going to be absolutely shocked! #BioLabs#Corruption#Covid19#BiologicalWarfare https://www.dailymail.co.uk/health/article-12357073/Unassuming-warehouse-California-turns-illegal-Chinese-run-virus-laboratory-genetically-engineering-mice-experimenting-HIV-herpes-malaria.html

Egountchi Behanzin Officiel

@egountchibehanzinofficiel · Post #7900 · 23.12.2024 г., 08:31

⚠️☢️🌍 À NE PAS MANQUER ! 🌍 Dans l'émission "Une heure avec Impuls", animée par Tanguy, Egountchi Behanzin s'attaque à des sujets cruciaux : 🦟 Moustiques OGM, ⚠️ Bioterrorisme, 🔬 Target Malaria, 🇺🇸 Biolab Américain en Afrique, 💔 Les conséquences de l’assassinat d’Igor Kirillov. Ne ratez pas cette occasion d'entendre des analyses percutantes sur ces enjeux majeurs qui impactent notre continent. 📺 Pour visionner l'émission, rendez-vous sur YouTube ➡️https://youtu.be/uornb6UUNkw?feature=shared ou Telegram ! ➡️https://t.me/egountchibehanzinTV Partagez et sensibilisez vos amis et proches à ces problématiques essentielles. La lutte continue ! #EgountchiBehanzin#MoustiquesOGM#Bioterrorisme#TargetMalaria#Biolabs#Afrique#IgorKirilov @egountchibehanzinTV