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

Пребарај: #cji

当前筛选 #cji清除筛选
RISE Moldova

@risemoldova · Post #112 · 07.04.2022 г., 07:04

Banii lui Dodon 💶 din Bahamas 🌴 - este investigația care l-a deranjat puternic pe Igor Dodon și ne-a atras în cel mai lung proces de judecată, în care a fost implicată redacția RISE Moldova. Detalii, AICI. În final, RISE Moldova a câștigat dosarul la CEDO, iar despre aceasta am scris AICI. Recent, Centrul pentru Jurnalism Independent Moldova a analizat deciziile semnate de judecătorii moldoveni care au încercat să desființeze ancheta "Banii lui Dodon din Bahamas", și a publicat un studiu amplu despre executarea hotărârii CtEDO în cauza RISE Moldova și Iurie Sanduta contra Moldovei. Studiul poate fi citit, AICI. Din concluziile și recomandările cercetării #CJI, am extras câteva observații și idei de reținut: 📍 "Cauza RISE Moldova și Iurie Sanduța denotă că provocările la adresa libertății de exprimare a jurnaliștilor nu au încetat". 📍 "Condamnarea statului la CtEDO în această cauză nu a avut loc din cauza precarității cadrului legal național, ci se „datorează” aplicării eronate a legii de către instanțele de judecată, fie că este vorba despre abateri comise cu intenție ori din neglijență gravă". 📍 "Republica Moldova este obligată să elaboreze și să prezinte Comitetului de Miniștri al Consiliului Europei un Plan de acțiuni în care să prevadă măsurile pe care trebuie să le întreprindă pentru a remedia și preveni repetitivitatea încălcărilor constatate în cauza RISE Moldova și Iurie Sanduța c. Moldovei". 📍 "Gravitatea abaterilor disciplinare comise de către judecătorii cărora le-a fost dedusă soluționarea cauzei în instanțele naționale impune necesitatea ca Ministerul Justiției al Republicii Moldova să sesizeze Consiliului Superior al Magistraturii în vederea constatării abaterii și sancționării judecătorilor vizați". *** Susține activitatea noastră, AICI sau AICI. 🔎#Redirecționează 2% din impozitul tău pe venit pentru investigațiile care fac istorie. Când depui declarația la Fisc, în format on-line sau print, trebuie să indici codul fiscal al RISE Moldova: 1014620001999 (în caseta M1 din formularul CET 18). *** Urmărește-ne și pe Instagram și Twitter.

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1932 · 12.04.2026 г., 00:32

😁Samurai Submissions: finish Quickly From Turtle by Kenta Iwamoto😁 ➡️In Samurai Submissions, BJJ’s fastest-rising star and B-Team standout breaks down his signature system for lightning-fast, high-percentage submissions from turtle — attacks so sneaky your opponents won’t realize they’re in danger until it’s already over. ➡️Kenta’s approach is brutally efficient: minimal movement, tight control, and submissions that hit before your opponent can react. $127😍$9.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #KentaIwamoto#Submissions#NoGi#CJI

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1812 · 06.05.2025 г., 01:49

🔥NEW RELEASE🔥 😁X Lock: For When Letting Go Was Never Your Strong Suit By Owen Jones😁 ➡️Unlock a devastating new layer to your leg lock game with X Lock, the cutting-edge instructional by Owen Jones, one of the most technical minds rising through the ranks of B Team Jiu-Jitsu. ➡️Whether you're a straight ankle lock specialist or want to add serious firepower to your lower body arsenal, this instructional is designed to elevate your game, from positional awareness to crushing submissions. ➡️Use the X Lock to make your straight ankle locks faster, tighter, and more lethal—with precision grip mechanics that force the tap. $99😍$9.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #OwenJones#Leglocks#CJI#NoGi 💁‍♀️Buy💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1794 · 31.03.2025 г., 16:47

🔥NEW RELEASE🔥 😁Things I Didn't Show To Craig Jones: Maintaining An Advantage Over Time - Outside Passing By Jozef Chen😁 ➡️Unlock the secrets to unstoppable no-gi guard passing with JPoint Camping, the latest BJJ instructional from one of the most elite no-gi competitors today, Jozef Chen. ➡️In this systematic instructional, Jozef guides you through the step-by-step process of dismantling even the most difficult no-gi guards, using a series of tried-and-true methods refined over years of high-level competition. ➡️Transform your guard passing into a dominant, methodical force, and learn how to effortlessly break through any guard. With Jozef Chen’s expert guidance, you’ll develop the mindset, precision, and fluidity needed to consistently control the pace and flow of your no-gi matches. $127😍$11.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #JozefChen#CraigJones#CJI#GuardPassing 💁‍♀️Buy 💁‍♀️