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

Пребарај: #submission

当前筛选 #submission清除筛选
bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1844 · 17.07.2025 г., 23:50

🔥NEW RELEASE🔥 😁Crucifix Masterclass by Brian Glick😁 ➡️A direct student of legendary coach John Danaher, Brian breaks down the crucifix in a methodical, accessible system designed to transform this powerful position into a high-percentage part of your game. ➡️Instead, it leverages advanced, submission-based control points that create tremendous vulnerability in your opponent while giving you near-total dominance. ̶$̶1̶9̶7̶😍$14.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #BrianGlick#Submission#NoGi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1913 · 09.02.2026 г., 16:39

😁Submission Mastery: Omoplata by Giancarlo Bodoni😁 ➡️Giancarlo Bodoni — 2x ADCC champion, CJI standout, and elite New Wave athlete under the legendary John Danaher and Gordon Ryan — unveils his groundbreaking system for mastering one of grappling’s most underutilized weapons: the omoplata. ➡️This is not just a submission tutorial. This is a total redefinition of the omoplata for the modern no-gi game — built on elite-level mechanics, control, and finishing options that go far beyond what you thought possible. $197😍$14.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #GiancarloBodoni#Submission#NoGi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1876 · 11.11.2025 г., 18:11

🔥NEW RELEASE🔥 😁Loop Choke by Nicholas Meregali😁 ➡️The Loop Choke is one of the most powerful and underrated submissions in Jiu-Jitsu. ➡️In this complete 2.5-hour series, Nicholas breaks down every layer of the position, from the core mechanics to advanced scenarios, covering how to attack from bottom. and top $127😍$14.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #NicholasMeregali#Submission#Gi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1795 · 31.03.2025 г., 19:34

🔥DEAL OF THE WEEK🔥 😁Systematically Attacking The Arm Bar by Gordon Ryan😁 ➡️DEAL ENDS ON APRIL 7TH $349😍$9.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #GordonRyan#ADCC#Submission#FloGrappling 💁‍♀️Buy 💁‍♀️