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

Резултати

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

Пребарај: #paws

当前筛选 #paws清除筛选
Airdrop Gold : Crypto Airdrop

@airdropgoldchannel · Post #158025 · 08.03.2025 г., 20:28

#PAWS Solana OG Allocation If you have an active Solana wallet, check if you’ve received an airdrop or not. Here's the full list of the 13 projects in the Solana OG Allocation: Memecoins: DogWifHat ($WIF) - Bonk ($BONK) Pudgy Penguins ($PENGU) STONKS ($STNK) GigaChad ($GIGA) Eliza ($Ai16z) DeFi: Magic Eden ($ME) Phantom Wallet Jupiter ($JUP) Raydium ($RAY) Solana Phone Jito ($JTO) Mad Lads by Backpack Paws Airdrop Checker: https://paws.community/app/solana-og

Hashtags

Airdrop Gold : Crypto Airdrop

@airdropgoldchannel · Post #157896 · 12.01.2025 г., 16:32

#PAWS The airdrop criteria have appeared on the PAWS website !! ➡Open the PAWS app ➡Tap "Check Eligibility" ➡See if you qualify for the airdrop! Are you Eligible? 🗿 Yes 😢 No

Hashtags

Airdrop Gold : Crypto Airdrop

@airdropgoldchannel · Post #157873 · 05.11.2024 г., 16:12

New Task added in @Paws Get 5000 Paws by completing this task 👉 Big #PAWS Sighted In These Area! 🐶 New task just dropped. Put 🐾 in your name and stay on marked trails! 👉 PLAY PAWS : CLICK

Hashtags

Airdrop Gold : Crypto Airdrop

@airdropgoldchannel · Post #157861 · 01.11.2024 г., 07:31

#Paws Bot is Verified !! Just a few days ago, the @PAWS bot launched and within less then 3 days it reached a massive milestone of 10 million users! 🤯 And now, it's officially verified by Telegram! 🎉 👉PLAY : @PAWS

Hashtags

Airdrop Center

@centralchanel · Post #16458 · 06.02.2025 г., 19:24

💎PAWS ONE LAST RIDE 💎 The final mandatory check is live! Only those who finish it will stay in. Go to PAWS Web & check it off. P.S. Special roles for holding 10+ Vouchers are now available in PAWS Discord!🐾 #PAWS HIGHER 🐶

Hashtags

Crypto currents | Money, Games, News.

@cryptocurrentsglobal · Post #3025 · 07.02.2025 г., 05:56

💎PAWS ONE LAST RIDE 💎 The final mandatory check is live! Only those who finish it will stay in. Go to PAWS Web & check it off. P.S. Special roles for holding 10+ Vouchers are now available in PAWS Discord!🐾 #PAWS HIGHER 🐶

Hashtags

Ton Cryptans

@toncryptans · Post #2491 · 16.04.2025 г., 11:14

🏁 Верите во что-то? 👍 — верю 🔥 — лесом ❤️ — не участвовал 🤩 Никакие данаты не окупились, ни крупные, ни мелкие. Пока жестко побрили. В принципе все без изменений 😄 ❗️Под каждым постом, комментарий, продержавшийся 15 минут не перекрытый следующим комментарием, получает подарок TG #PAWS - - - - - - - - - - - - 🤓Ton Cryptans | Чат | UNI | SCAM - - - - - - - - - - - - 🤓Игры | ⭐️ Купить STARS - - - - - - - - - - - - How to read our content in your language / فارسیفارسی

Hashtags

Crypto & Gifts NEWS

@serbadgernews · Post #1888 · 03.11.2024 г., 05:47

#paws 🐾PAWS 18,000,000 million participants 🔥The project is gaining momentum, the next trail according to the hint in the video is the X Empire project, they should still drop coins for it💎 💵Easy money 10-50$, without doing anything @PAWS -------------------------------------------------- 🤘Blums code

Hashtags

Crypto Drop Club

@drop_cryptogo · Post #1660 · 15.02.2025 г., 15:52

🗣#PAWS – Upcoming Airdrop for Solana DeFi Users PAWS has announced an upcoming airdrop, rewarding everyone who has used DeFi on Solana! 🔗Post 💡 What to Expect: 🟠 Rewards for Jupiter swaps 🟠 Perks for NFT purchases on Magic Eden 🟠 Bonuses for using Phantom Wallet ⏳ Now is the time to prepare your accounts for the drop! ☝️ Start trading on Bybit Crypto Drop Club 👉 SUBSCRIBE

Hashtags

123•••10•••20•••2526
ПретходнаСтраница 1 од 26Следна