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

Резултати

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

Пребарај: #saopaulo

当前筛选 #saopaulo清除筛选
Reuters: World

@reutersworldchannel · Post #149190 · 10.10.2021 г., 17:59

Boxing offers kids a fighting chance in Sao Paulo’s favelas A new boxing program in Sao Paulo’s gritty south side aims to ensure kids stay in school, keep them active and teach them discipline. #Boxing#SaoPaulo#Brazil#favela#News#Reuters Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

AI match predictions

@ai_match_prediction · Post #11132 · 21.03.2026 г., 13:05

Brazil Serie A🇧🇷 2026-03-21 19:00 UTC RB Bragantino vs. Botafogo Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Botafogo 1:2 #RBBragantino#Botafogo 2026-03-21 21:30 UTC Fluminense vs. Atletico-MG Predicted outcome: Fluminense✅ Predicted score: 2:0 Actual: Fluminense 1:0 #Fluminense#AtleticoMG 2026-03-22 00:00 UTC Sao Paulo vs. Palmeiras Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Palmeiras 0:1 #SaoPaulo#Palmeiras #Football#BrazilSerieA

AI match predictions

@ai_match_prediction · Post #11301 · 04.04.2026 г., 17:05

Brazil Serie A🇧🇷 2026-04-04 21:30 UTC Sao Paulo vs. Cruzeiro Predicted outcome: Sao Paulo✅ Predicted score: 2:1 Actual: Sao Paulo 4:1 #SaoPaulo#Cruzeiro 2026-04-04 23:30 UTC Coritiba vs. Fluminense Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #Coritiba#Fluminense 2026-04-05 00:00 UTC Vasco DA Gama vs. Botafogo Predicted outcome: Vasco DA Gama❌ Predicted score: 2:1 Actual: Botafogo 1:2 #VascoDAGama#Botafogo #Football#BrazilSerieA

AI match predictions

@ai_match_prediction · Post #11442 · 11.04.2026 г., 13:05

Brazil Serie A🇧🇷 2026-04-11 19:30 UTC Vitoria vs. Sao Paulo Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Vitoria 2:0 #Vitoria#SaoPaulo 2026-04-11 21:30 UTC Mirassol vs. Bahia Predicted outcome: Mirassol❌ Predicted score: 2:1 Actual: Bahia 1:2 #Mirassol#Bahia 2026-04-11 23:00 UTC Santos vs. Atletico-MG Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Santos 1:0 #Santos#AtleticoMG 2026-04-11 23:30 UTC Internacional vs. Gremio Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #Internacional#Gremio #Football#BrazilSerieA

AI match predictions

@ai_match_prediction · Post #11581 · 18.04.2026 г., 17:05

Brazil Serie A🇧🇷 2026-04-18 21:30 UTC Chapecoense-sc vs. Botafogo Predicted outcome: Botafogo✅ Predicted score: 1:2 Actual: Botafogo 1:4 #Chapecoensesc#Botafogo 2026-04-18 21:30 UTC Vasco DA Gama vs. Sao Paulo Predicted outcome: Vasco DA Gama✅ Predicted score: 2:1 Actual: Vasco DA Gama 2:1 #VascoDAGama#SaoPaulo 2026-04-18 23:00 UTC Vitoria vs. Corinthians Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #Vitoria#Corinthians 2026-04-18 23:30 UTC Cruzeiro vs. Gremio Predicted outcome: Cruzeiro✅ Predicted score: 2:1 Actual: Cruzeiro 2:0 #Cruzeiro#Gremio #Football#BrazilSerieA

AI match predictions

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

CONMEBOL Sudamericana🌎 2026-05-07 22:00 UTC O'Higgins vs. Sao Paulo Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #OHiggins#SaoPaulo 2026-05-07 22:00 UTC Boston River vs. Millonarios Predicted outcome: Millonarios✅ Predicted score: 0:1 Actual: Millonarios 2:4 #BostonRiver#Millonarios 2026-05-08 00:30 UTC Carabobo FC vs. River Plate Predicted outcome: Draw❌ Predicted score: 0:0 Actual: River Plate 1:2 #CaraboboFC#RiverPlate 2026-05-08 00:30 UTC Blooming vs. RB Bragantino Predicted outcome: Blooming❌ Predicted score: 3:2 Actual: RB Bragantino 0:6 #Blooming#RBBragantino #Football#CopaSudamericana

AI match predictions

@ai_match_prediction · Post #11745 · 25.04.2026 г., 17:05

Brazil Serie A🇧🇷 2026-04-25 21:30 UTC Bahia vs. Santos Predicted outcome: Bahia❌ Predicted score: 2:1 Actual: Draw 2:2 #Bahia#Santos 2026-04-25 21:30 UTC Botafogo vs. Internacional Predicted outcome: Botafogo❌ Predicted score: 2:1 Actual: Draw 2:2 #Botafogo#Internacional 2026-04-25 21:30 UTC Remo vs. Cruzeiro Predicted outcome: Cruzeiro✅ Predicted score: 0:1 Actual: Cruzeiro 0:1 #remo#Cruzeiro 2026-04-26 00:00 UTC Sao Paulo vs. Mirassol Predicted outcome: Sao Paulo✅ Predicted score: 2:1 Actual: Sao Paulo 1:0 #SaoPaulo#Mirassol #Football#BrazilSerieA

AI match predictions

@ai_match_prediction · Post #11510 · 14.04.2026 г., 17:05

CONMEBOL Sudamericana🌎 2026-04-14 22:00 UTC Sao Paulo vs. O'Higgins Predicted outcome: Sao Paulo✅ Predicted score: 1:0 Actual: Sao Paulo 2:0 #SaoPaulo#OHiggins 2026-04-14 22:00 UTC Gremio vs. Deportivo Riestra Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Gremio 1:0 #Gremio#DeportivoRiestra 2026-04-15 00:00 UTC Vasco DA Gama vs. A. Italiano Predicted outcome: Draw❌ Predicted score: 1:1 Actual: A. Italiano 1:2 #VascoDAGama#AItaliano 2026-04-15 00:30 UTC Santos vs. Deportivo Recoleta Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #Santos#DeportivoRecoleta 2026-04-15 00:30 UTC Palestino vs. Atletico Torque Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Atletico Torque 0:2 #Palestino#AtleticoTorque #Football#CopaSudamericana

AI match predictions

@ai_match_prediction · Post #11898 · 03.05.2026 г., 13:05

Brazil Serie A🇧🇷 2026-05-03 19:00 UTC Sao Paulo vs. Bahia Predicted outcome: Sao Paulo❌ Predicted score: 2:1 Actual: Draw 2:2 #SaoPaulo#Bahia 2026-05-03 19:00 UTC Flamengo vs. Vasco DA Gama Predicted outcome: Flamengo❌ Predicted score: 3:1 Actual: Draw 2:2 #Flamengo#VascoDAGama 2026-05-03 21:30 UTC Internacional vs. Fluminense Predicted outcome: Fluminense❌ Predicted score: 1:2 Actual: Internacional 2:0 #Internacional#Fluminense 2026-05-03 21:30 UTC Chapecoense-sc vs. RB Bragantino Predicted outcome: RB Bragantino✅ Predicted score: 1:2 Actual: RB Bragantino 1:2 #Chapecoensesc#RBBragantino 2026-05-03 23:30 UTC Mirassol vs. Corinthians Predicted outcome: Mirassol✅ Predicted score: 2:1 Actual: Mirassol 2:1 #Mirassol#Corinthians #Football#BrazilSerieA

AI match predictions

@ai_match_prediction · Post #11366 · 07.04.2026 г., 17:05

CONMEBOL Sudamericana🌎 2026-04-07 22:00 UTC Barracas Central vs. Vasco DA Gama Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #BarracasCentral#VascoDAGama 2026-04-07 22:00 UTC Independiente Petrolero vs. Racing Club Predicted outcome: Racing Club✅ Predicted score: 1:3 Actual: Racing Club 1:3 #IndependientePetrolero#RacingClub 2026-04-08 00:00 UTC O'Higgins vs. Millonarios Predicted outcome: Millonarios❌ Predicted score: 1:3 Actual: O'Higgins 2:0 #OHiggins#Millonarios 2026-04-08 00:30 UTC Boston River vs. Sao Paulo Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Sao Paulo 0:1 #BostonRiver#SaoPaulo 2026-04-08 02:00 UTC Alianza Atletico vs. Tigre Predicted outcome: Tigre❌ Predicted score: 1:2 Actual: Draw 1:1 #AlianzaAtletico#Tigre #Football#CopaSudamericana

AI match predictions

@ai_match_prediction · Post #12030 · 10.05.2026 г., 13:05

Brazil Serie A🇧🇷 2026-05-10 19:00 UTC Atletico-MG vs. Botafogo Predicted outcome: Atletico-MG❌ Predicted score: 3:2 Actual: Draw 1:1 #AtleticoMG#Botafogo 2026-05-10 21:30 UTC Santos vs. RB Bragantino Predicted outcome: Santos✅ Predicted score: 2:1 Actual: Santos 2:0 #Santos#RBBragantino 2026-05-10 21:30 UTC Corinthians vs. Sao Paulo Predicted outcome: Corinthians✅ Predicted score: 2:1 Actual: Corinthians 3:2 #Corinthians#SaoPaulo 2026-05-10 21:30 UTC Mirassol vs. Chapecoense-sc Predicted outcome: Mirassol❌ Predicted score: 3:0 Actual: Draw 1:1 #Mirassol#Chapecoensesc 2026-05-10 22:30 UTC Gremio vs. Flamengo Predicted outcome: Flamengo✅ Predicted score: 1:2 Actual: Flamengo 0:1 #Gremio#Flamengo 2026-05-10 23:30 UTC Vasco DA Gama vs. Atletico Paranaense Predicted outcome: Vasco DA Gama✅ Predicted score: 2:1 Actual: Vasco DA Gama 1:0 #VascoDAGama#AtleticoParanaense #Football#BrazilSerieA

AI match predictions

@ai_match_prediction · Post #11801 · 28.04.2026 г., 17:05

CONMEBOL Sudamericana🌎 2026-04-28 22:00 UTC Botafogo vs. Independiente Petrolero Predicted outcome: Botafogo✅ Predicted score: 2:0 Actual: Botafogo 3:0 #Botafogo#IndependientePetrolero 2026-04-28 22:00 UTC San Lorenzo vs. Santos Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #SanLorenzo#Santos 2026-04-29 00:00 UTC Barracas Central vs. A. Italiano Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #BarracasCentral#AItaliano 2026-04-29 00:30 UTC Millonarios vs. Sao Paulo Predicted outcome: Sao Paulo❌ Predicted score: 1:2 Actual: Draw 0:0 #Millonarios#SaoPaulo 2026-04-29 00:30 UTC Deportivo Recoleta vs. Deportivo Cuenca Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #DeportivoRecoleta#DeportivoCuenca 2026-04-29 02:00 UTC O'Higgins vs. Boston River Predicted outcome: O'Higgins✅ Predicted score: 2:1 Actual: O'Higgins 2:0 #OHiggins#BostonRiver #Football#CopaSudamericana

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