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

Пребарај: #jasonrau

当前筛选 #jasonrau清除筛选
bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1852 · 03.08.2025 г., 22:38

🔥NEW RELEASE🔥 😁Dynamically Combining Inside & Outside Passing by Jason Rau😁 ➡️Unlock a truly adaptive guard passing game with Jason Rau’s groundbreaking system that seamlessly blends tight inside pressure passing with loose outside movement. ➡️Learn how to fluidly switch between styles depending on your opponent’s reactions, making your passing game feel unpredictable, overwhelming, and unshakable. $127😍$11.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #JasonRau#Passing#NoGi#ADCC 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1805 · 18.04.2025 г., 02:10

🔥NEW RELEASE🔥 😁Understanding The Reap By Jason Rau😁 ➡️Unlock the power of one of Brazilian Jiu-Jitsu’s most misunderstood and effective positions with Understanding The Reap by Jason Rau. ➡️This incredibly comprehensive course takes you deep into the intricacies of the "reap" — a position that is often overlooked, yet crucial for mastering lower body submissions, sweeps, guard passes, and even back takes. ➡️Whether you’re a beginner or an advanced practitioner, Jason Rau’s detailed breakdown of the reap will give you the tools to control and submit your opponent, defend with confidence, and add an entirely new dimension to your BJJ game. $99😍$9.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #JasonRau#BJJFanatics#NoGi#Leglocks 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1838 · 02.07.2025 г., 18:24

🔥NEW RELEASE🔥 😁Outside Ashi Reloaded by Jason Rau😁 ➡️Take your leg lock game to the next level with Outside Ashi Reloaded, an innovative instructional series by Jason Rau — a black belt under Matt Serra and one of our best-selling instructors. ➡️Jason dives deep into the strategic interplay between these attacks, teaching you how to create relentless pressure and chain submissions so that when your opponent defends one, they inevitably expose themselves to the other. $127😍$11.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #JasonRau#Leglocks#NoGi#OutsideAshi 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1903 · 05.01.2026 г., 19:36

🔥NEW RELEASE🔥 😁Dynamically Taking The Back (Turtle) by Jason Rau😁 ➡️Unlock the Ultimate Back-Taking Blueprint from Turtle with Dynamically Taking the Back (Turtle) — the revolutionary course by elite BJJ black belt Jason Rao, designed to take your control, timing, and back-attack game to a whole new level. ➡️From gripping strategies and handfighting to dynamic movement and pressure mechanics, you’ll learn how to turn every turtle situation into a back take with confidence and precision. $99😍$9.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #JasonRau#Turtle#NoGi#ADCC 💁‍♀️Buy 💁‍♀️