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

Резултати

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

Пребарај: #token

当前筛选 #token清除筛选
American Crypto©

@americancryptotrading · Post #27367 · 07.09.2025 г., 08:42

🇺🇸#TOKEN/USDT is testing the supportzone on the daily chart💁‍♂️ Strong upside potential on a bounce✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27150 · 10.02.2025 г., 12:47

🇺🇸#TOKEN/USDT is bouncing from the supportzone on the 3D timeframe🧐 Looking for a rise🐃 American Crypto©

Hashtags

Airdrop Presents 🗽

@airdrop_presents · Post #2082 · 07.12.2022 г., 16:52

🪂New airdrop: Smart Link Solution (SLS) 💰 Reward: 100,000 #token ($15,000) prize pool 👥 Referral: +1 Entries 🕰 Distribution: 1st January, 2023 🔗Airdrop Link:https://wn.nr/fgmdnH -Complete all tasks of the airdrop -Complete all tasks of the airdrop Done ✅Done✅Done✅Done✅ ⚠️Please remember: Only participate in completely free airdrops, never spend any penny for airdrop tokens

Hashtags

Airdrop Presents 🗽

@airdrop_presents · Post #1652 · 01.07.2022 г., 14:14

💧Airdrop : Naga Alpha Test💧 📣Complete Task: ➕ $5000 - IDO #token Price $0.01 📊Referral : 50 Top referrers will jave a whitelist details. 🏆Winners: 250 Player Lucky random have gift token, Nft game up to 5000$ 📅End date: 3th July 2022 💎Ratings: ⭐️⭐️⭐️ 🔛Naga Alpha Airdrop For Click 🔛 🌀 Follow Naga Alpha on Twitter and retweet the pinned post. 🌀 Follow Naga Alpha on Facebook 🌀 Enter Your Gmail 🌀 Submit Bep-20 address 📡 Enter your information to the airdrop bot. 🗞Note: All airdrop steps should be completed. 👨‍💼Business Inquiry: Admin || Admin2

Hashtags

Crypto GALAXY

@crypto_galaxy_signals · Post #1490 · 17.05.2024 г., 10:10

Coin: #TOKEN/USDT Direction: LONG Leverage: 10x - Cross - TAKE-PROFIT: 1 - 0,09847 ✔️ 2 - 0,10042 ✔️ 3 - 0,10237 ✔️ 4 - 0,10725 ✔️ 🔥 Profit: 101.69% 🔥 VIP 👉t.me/cryptoxadmin

Hashtags

SingSing Announcement

@singsingchannel · Post #958 · 03.11.2024 г., 00:32

We're eagerly counting down to Nov 11 for the IDO of the $SING token! Check out this handy $SING #token IDO Cheat Sheet below for all the essential info you need to know👇 🔸Total Supply: 2.4B 🔸IDO Price: $0.018 🔸Allocation: 11.11M (0.46% Total Supply) 🔸IDO Date: Nov 11, 2024 🔸Network: BSC, ARB, POLYGON 🔸Currency: USDT 🔸Terms: 20% at TGE, then linearly monthly vesting for the next 6 months 🔸LaunchPad:@Kommunitas - details 🎤Announcement | Chat | X (Twitter) | Website | Game

Hashtags

SingSing Announcement

@singsingchannel · Post #942 · 28.10.2024 г., 13:31

🎉 Exciting Announcement! 🎉 Mark your calendars for Nov 11, 2024,when the $SING Token Sale begins on the @Kommunitas launchpad! 🔗 Check out the project on Kommunitas platform here: https://launchpad.kommunitas.net/pool/SING/PublicCross 🧵 Dive into the X thread for essential details about the upcoming #token sale! 🎤Announcement | Chat | X (Twitter) | Website | Game

Hashtags

Venom Foundation Official

@venomfoundationofficial · Post #5 · 14.10.2022 г., 07:35

Venom Foundation explicitly states that by any means not going to do any kind of a #token pre-sale (private or public) or any other form of equity allocation. More in our statement ➡️ https://medium.com/@venom.foundation/mportant-venom-foundation-does-not-distribute-venom-utility-tokens-prior-to-the-official-launch-b3ffe84326f9

Hashtags

TONlines – News

@tonlines · Post #7253 · 17.05.2025 г., 16:26

⚡️Gatto Official Channel: Major Milestone with GTON Token Burn #GTON#token The Gatto Official Channel announces that the total burn of $GTON tokens has reached 1,000,000, effectively removing 5% of the supply from circulation. This community-driven effort strengthens the token's value and stability. Source: link @tonlines

Hashtags

TONlines – News

@tonlines · Post #7683 · 02.12.2025 г., 15:03

Gatto Official Channel: December Staking Begins #staking#token The Gatto Official Channel announces the start of the December staking period after taking the first snapshot of game balances. Staking will conclude on December 29th, and token holders should maintain their balances to receive rewards. Balance cuts will occur randomly each day. Source: link @tonlines

123•••67
ПретходнаСтраница 1 од 7Следна