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

Резултати

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

Пребарај: #climatetech

当前筛选 #climatetech清除筛选
ChatGPT AI Technology News

@chatgpt_officialnews · Post #262 · 28.08.2025 г., 09:02

🌐Climate Tech Gets an AI Upgrade! AI isn’t just about chatbots and robots — it’s now being used to fight climate change.🌱 Recent breakthroughs show AI can: ✔️ Predict extreme weather with higher accuracy. ✔️ Optimize energy grids for renewable power. ✔️ Reduce waste in agriculture and water usage. ✔️ Help cities design smarter, greener infrastructure. This could mean billions saved in disaster response and a faster transition to clean energy. But… the big question is: Will governments and companies adopt it fast enough?⌛ Would you trust AI to manage your city’s energy? ➖➖➖➖🔻 🧠 BOT: @Chatgpt_OfficialBOT 💎@Chatgpt_OfficialNews #️⃣#AI#ClimateTech#Innovation#NeuralHubAI ➖➖➖➖🔺

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40952 · 19.04.2026 г., 06:03

In Iceland, the CarbFix project captures CO2 from geothermal power plants. The CO2 is mixed with water and injected deep underground into basalt rock. It reacts with minerals in the rock and forms stable carbonate rock. The system has been operating at the Hellisheiði geothermal power plant. 🪨🌍💧⚗️ [Read more] @googlefactss #CarbonCapture#Iceland#CO2#ClimateTech

Venture Village Wall 🦄

@venturevillagewall · Post #3646 · 21.12.2024 г., 10:24

Accelergen Energy Raises $20M Accelergen Energy has secured $20 million in funding as of December 19, 2024. The firm focuses on delivering clean power assets characterized by robust and sustainable locational value through strategic investments, development, commercialization, and optimized operations. For more details, visit Accelergen Energy. #Accelergen#Energy#Funding#CleanPower#Investment#Sustainability#RenewableEnergy#Development#Commercialization#Operations#ClimateTech#GreenEnergy#Ecosystem#Infrastructure#PowerAssets#Technology#StrategicInvestment#CleanTech#EcoFriendly#LocationalValue

IELTS|Newspapers & Magazines|English

@emagzinewspars · Post #9365 · 18.10.2025 г., 09:37

#The_Time🇺🇸📕[PDF]⬇️ 27 #October2025 #Weekly_Magazines For learning, for free(dom). @backupofmagazines Meet the #Future of invention in TIME’s Best Inventions of 2025! 🤖 From humanoid robots folding laundry (#AI), to lab-grown #salmon, wildfire defense tech, and personalized #healthcare, this issue showcases 50+ breakthroughs that redefine home, work, and #sustainability. Discover how #FigureAI leads the #robotics revolution, dive into the #Barbie phenomenon, explore the rise of “Baby Boxes,” and relive the final #StrangerThings. A must-read collection for #tech lovers and #innovators alike. #BestInventions2025#Innovation#FutureOfWork#ClimateTech#Biotech#Netflix#HumanAI#TimeMagazine