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 слични објави

Пребарај: #lille

当前筛选 #lille清除筛选
Jean-Luc Mélenchon

@jlmelenchon · Post #3957 · 17.03.2026 г., 16:05

🔴 MEETING EXCEPTIONNEL À LILLE ! Jean-Luc Mélenchon sera à #Lille ce jeudi au grand palais à 19h pour soutenir la liste insoumise, et surtout écologiste et populaire ! ✊ Dimanche, nous pouvons l’emporter ! Soyons nombreux et nombreuses ! Ma publication à retrouver sur : 👉Twitter 👉Instagram 👉Facebook 👉Tik tok ➡️ Rejoignez le canal telegram : https://t.me/Lahouaria_Addouche

Hashtags

🏆 Info 288 - DEPORTES

@info288_deportes · Post #35489 · 02.10.2024 г., 21:20

⚽️🇪🇺Champions Lille 1-0 Real Madrid#Champions#Lille#RealMadrid El Real Madrid cayó por primera vez en la temporada y segunda en el año. Desde el 18 de enero, en aquella noche copera del Metropolitano. Puede que el derbi dejase tocado al equipo de Ancelotti, que al menos en los últimos minutos pudo igualar un partido plano. Tres paradas de reflejos de Chevalier evitaron que el Madrid igualara en una reacción muy tardía. El Lille aprovechó los desajustes blancos y conquistó una victoria de enorme prestigio. https://www.marca.com/futbol/champions-league/cronica/2024/10/02/66fda5bcca4741d9138b4572.html 🏆@Info288_deportes

🏆 Info 288 - DEPORTES

@info288_deportes · Post #35683 · 23.10.2024 г., 21:11

⚽️🇪🇺Champions Atlético 1-3 Lille#Champions#Atlético#Lille El Atlético de Madrid ha perdido este miércoles por 1-3 frente al LOSC Lille en la jornada 3 de la fase de liga en la Champions League, a causa sobre todo de un polémico penalti encajado a cuarto de hora de la conclusión, en un partido disputado en el Riyadh Air Metropolitano y tras el cual los colchoneros se han complicado su futuro inmediato en este torneo. https://www.europapress.es/deportes/futbol-00162/noticia-atletico-madrid-pierde-lille-complica-futuro-champions-league-20241023230223.html 🏆@Info288_deportes

Futplanet

@Fut_planet · Post #11455 · 16.05.2024 г., 12:25

Lille y Stade Brestois se clasificaron a la próxima edición de la UCL🇪🇺 El Lille llegaron hasta los octavos de final de la UCL en la temporada 21/22. Mientras que el Brest jugará por primera la UCL en su historia tras una increíble temporada en la Ligue 1 @Fut_planet⚜️#UCL🇪🇺#Lille🇫🇷 #Brest🇫🇷

AI match predictions

@ai_match_prediction · Post #11281 · 04.04.2026 г., 09:05

France Ligue 1🇫🇷 2026-04-04 15:00 UTC Strasbourg vs. Nice Predicted outcome: Strasbourg✅ Predicted score: 2:1 Actual: Strasbourg 3:1 #Strasbourg#Nice 2026-04-04 17:00 UTC Stade Brestois 29 vs. Rennes Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Rennes 3:4 #StadeBrestois29#Rennes 2026-04-04 19:05 UTC Lille vs. Lens Predicted outcome: Lens❌ Predicted score: 1:2 Actual: Lille 3:0 #Lille#Lens #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11473 · 12.04.2026 г., 09:05

France Ligue 1🇫🇷 2026-04-12 15:15 UTC Nice vs. Le Havre Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #Nice#LEHavre 2026-04-12 15:15 UTC Toulouse vs. Lille Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Lille 0:4 #Toulouse#Lille 2026-04-12 18:45 UTC Lyon vs. Lorient Predicted outcome: Lyon✅ Predicted score: 2:1 Actual: Lyon 2:0 #Lyon#Lorient #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11568 · 18.04.2026 г., 09:05

France Ligue 1🇫🇷 2026-04-18 15:00 UTC Lorient vs. Marseille Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Lorient 2:0 #Lorient#Marseille 2026-04-18 17:00 UTC Angers vs. Le Havre Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #Angers#LEHavre 2026-04-18 19:05 UTC Lille vs. Nice Predicted outcome: Lille❌ Predicted score: 2:1 Actual: Draw 0:0 #Lille#Nice #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11749 · 26.04.2026 г., 09:05

France Ligue 1🇫🇷 2026-04-26 13:00 UTC Lorient vs. Strasbourg Predicted outcome: Lorient❌ Predicted score: 3:2 Actual: Strasbourg 2:3 #Lorient#Strasbourg 2026-04-26 15:15 UTC Rennes vs. Nantes Predicted outcome: Rennes✅ Predicted score: 2:1 Actual: Rennes 2:1 #Rennes#Nantes 2026-04-26 15:15 UTC Le Havre vs. Metz Predicted outcome: Le Havre❌ Predicted score: 2:1 Actual: Draw 4:4 #LEHavre#Metz 2026-04-26 15:15 UTC Paris FC vs. Lille Predicted outcome: Lille✅ Predicted score: 1:2 Actual: Lille 0:1 #ParisFC#Lille 2026-04-26 18:45 UTC Marseille vs. Nice Predicted outcome: Marseille❌ Predicted score: 3:1 Actual: Draw 1:1 #Marseille#Nice #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11152 · 22.03.2026 г., 09:05

France Ligue 1🇫🇷 2026-03-22 14:00 UTC Lyon vs. Monaco Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Monaco 1:2 #Lyon#Monaco 2026-03-22 16:15 UTC Marseille vs. Lille Predicted outcome: Marseille❌ Predicted score: 2:1 Actual: Lille 1:2 #Marseille#Lille 2026-03-22 16:15 UTC Rennes vs. Metz Predicted outcome: Rennes❌ Predicted score: 3:1 Actual: Draw 0:0 #Rennes#Metz 2026-03-22 16:15 UTC Paris FC vs. Le Havre Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Paris FC 3:2 #ParisFC#LEHavre 🔥 PREMIUM PICK 🔥 2026-03-22 19:45 UTC Nantes vs. Strasbourg Predicted outcome: Strasbourg✅ Predicted score: 1:2 Actual: Strasbourg 2:3 #Nantes#Strasbourg #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11875 · 03.05.2026 г., 05:05

France Ligue 1🇫🇷 2026-05-03 13:00 UTC Lille vs. Le Havre Predicted outcome: Lille❌ Predicted score: 1:0 Actual: Draw 1:1 #Lille#LEHavre 2026-05-03 15:15 UTC Strasbourg vs. Toulouse Predicted outcome: Strasbourg❌ Predicted score: 2:1 Actual: Toulouse 1:2 #Strasbourg#Toulouse 2026-05-03 15:15 UTC Auxerre vs. Angers Predicted outcome: Auxerre✅ Predicted score: 2:1 Actual: Auxerre 3:1 #Auxerre#Angers 2026-05-03 15:15 UTC Paris FC vs. Stade Brestois 29 Predicted outcome: Paris FC✅ Predicted score: 2:1 Actual: Paris FC 4:0 #ParisFC#StadeBrestois29 2026-05-03 18:45 UTC Lyon vs. Rennes Predicted outcome: Lyon✅ Predicted score: 3:2 Actual: Lyon 4:2 #Lyon#Rennes #Football#FranceLigue1

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