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

Резултати

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

Пребарај: #penarol

当前筛选 #penarol清除筛选
AI match predictions

@ai_match_prediction · Post #11633 · 20.04.2026 г., 13:05

Uruguay Primera División - Apertura🇺🇾 2026-04-20 20:00 UTC Boston River vs. Cerro Largo Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Boston River 1:0 #BostonRiver#CerroLargo 2026-04-20 23:30 UTC Penarol vs. Juventud Predicted outcome: Penarol❌ Predicted score: 2:1 Actual: Draw 2:2 #Penarol#Juventud #Football#UruguayPrimeraDivisión

AI match predictions

@ai_match_prediction · Post #11294 · 04.04.2026 г., 13:05

Uruguay Primera División - Apertura🇺🇾 2026-04-04 18:30 UTC Danubio vs. Atletico Torque Predicted outcome: Danubio❌ Predicted score: 2:1 Actual: Draw 1:1 #Danubio#AtleticoTorque 2026-04-04 22:00 UTC Progreso vs. Penarol Predicted outcome: Penarol✅ Predicted score: 1:2 Actual: Penarol 0:2 #Progreso#Penarol #Football#UruguayPrimeraDivisión

AI match predictions

@ai_match_prediction · Post #12052 · 11.05.2026 г., 13:05

Uruguay Primera División - Apertura🇺🇾 2026-05-11 20:00 UTC Deportivo Maldonado vs. Boston River Predicted outcome: Deportivo Maldonado✅ Predicted score: 2:1 Actual: Deportivo Maldonado 2:1 #DeportivoMaldonado#BostonRiver 2026-05-11 23:30 UTC Cerro Largo vs. Penarol Predicted outcome: Penarol✅ Predicted score: 1:2 Actual: Penarol 2:3 #CerroLargo#Penarol #Football#UruguayPrimeraDivisión

Локо-пропаганда

@lokopropaganda · Post #1676 · 14.01.2026 г., 09:05

📍Montevideo🇺🇾 ⚽️ Penarol 1-0 Central Espanol 🏆 Copa de la Liga 🏟️ Campeon del Siglo 📆 13.01.2026 Потихоньку страны Южной Америки просыпаются от межсезонья. Уругвайцы вот с Копа де ла Лига стартуют, формат на выбывание, так что скоро уже и финал увидим. А вчера «Пеньяроль» вышел в четвертьфинал, туго и лишь благодаря серии пенальти. Гораздо лучше выступили их фанаты. Barra Amsterdam окрасили свою трибуну густыми дымами в цветах клуба попутно отшизив за всю хурму. #Penarol#Ultras#Hooligans#Pyro#BarraAmsterdam#Uruguay

AI match predictions

@ai_match_prediction · Post #11179 · 25.03.2026 г., 09:05

Uruguay Primera División - Apertura🇺🇾 2026-03-25 17:00 UTC Albion FC vs. Wanderers Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Albion FC 2:1 #AlbionFC#Wanderers 2026-03-25 20:00 UTC Cerro vs. Juventud Predicted outcome: Juventud❌ Predicted score: 0:1 Actual: Cerro 1:0 #Cerro#Juventud 2026-03-25 23:30 UTC Boston River vs. Penarol Predicted outcome: Penarol✅ Predicted score: 0:1 Actual: Penarol 0:2 #BostonRiver#Penarol #Football#UruguayPrimeraDivisión

AI match predictions

@ai_match_prediction · Post #11760 · 26.04.2026 г., 09:07

Uruguay Primera División - Apertura🇺🇾 2026-04-26 13:00 UTC Central Espanol vs. Cerro Predicted outcome: Central Espanol✅ Predicted score: 2:1 Actual: Central Espanol 3:1 #CentralEspanol#Cerro 2026-04-26 18:30 UTC Cerro Largo vs. Racing Montevideo Predicted outcome: Racing Montevideo✅ Predicted score: 1:2 Actual: Racing Montevideo 0:1 #CerroLargo#RacingMontevideo 2026-04-26 22:00 UTC Wanderers vs. Penarol Predicted outcome: Penarol❌ Predicted score: 1:2 Actual: Wanderers 1:0 #Wanderers#Penarol #Football#UruguayPrimeraDivisión

AI match predictions

@ai_match_prediction · Post #11390 · 09.04.2026 г., 17:05

CONMEBOL Libertadores🌎 2026-04-09 22:00 UTC Rosario Central vs. Independiente del Valle Predicted outcome: Independiente del Valle❌ Predicted score: 1:2 Actual: Draw 0:0 #RosarioCentral#IndependientedelValle 2026-04-09 22:00 UTC UCV vs. Libertad Asuncion Predicted outcome: Draw❌ Predicted score: 1:1 Actual: UCV 3:1 #UCV#LibertadAsuncion 2026-04-10 00:00 UTC Platense vs. Corinthians Predicted outcome: Corinthians✅ Predicted score: 1:2 Actual: Corinthians 0:2 #Platense#Corinthians 2026-04-10 02:00 UTC Santa Fe vs. Penarol Predicted outcome: Penarol❌ Predicted score: 0:1 Actual: Draw 1:1 #SantaFe#Penarol #Football#CopaLibertadores

AI match predictions

@ai_match_prediction · Post #11821 · 30.04.2026 г., 17:05

CONMEBOL Libertadores🌎 2026-04-30 22:00 UTC Independ. Rivadavia vs. Deportivo La Guaira Predicted outcome: Independ. Rivadavia✅ Predicted score: 2:1 Actual: Independ. Rivadavia 4:1 #IndependienteRivadavia#DeportivoLaGuaira 2026-04-30 22:00 UTC Bolívar vs. Fluminense Predicted outcome: Fluminense❌ Predicted score: 1:2 Actual: Bolívar 2:0 #Bolvar#Fluminense 2026-05-01 00:00 UTC Corinthians vs. Penarol Predicted outcome: Corinthians✅ Predicted score: 2:1 Actual: Corinthians 2:0 #Corinthians#Penarol 2026-05-01 02:00 UTC Independiente Medellin vs. Cusco Predicted outcome: Independiente Medellin✅ Predicted score: 2:0 Actual: Independiente Medellin 1:0 #IndependienteMedellin#Cusco #Football#CopaLibertadores

AI match predictions

@ai_match_prediction · Post #11952 · 07.05.2026 г., 17:05

CONMEBOL Libertadores🌎 2026-05-07 22:00 UTC Platense vs. Penarol Predicted outcome: Platense❌ Predicted score: 2:1 Actual: Draw 1:1 #Platense#Penarol 2026-05-07 22:00 UTC Mirassol vs. LDU de Quito Predicted outcome: Mirassol✅ Predicted score: 1:0 Actual: Mirassol 2:0 #Mirassol#LDUdeQuito 2026-05-08 00:00 UTC Coquimbo Unido vs. Universitario Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Coquimbo Unido 2:1 #CoquimboUnido#Universitario 2026-05-08 02:00 UTC Junior vs. Cerro Porteno Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Cerro Porteno 0:1 #Junior#CerroPorteno #Football#CopaLibertadores

12
ПретходнаСтраница 1 од 2Следна