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

Пребарај: #minting

当前筛选 #minting清除筛选
Crypto M - Crypto News

@CryptoM · Post #65066 · 10.04.2026 г., 18:14

🚀 Circle Mints Additional 250 Million USDC on Solana Blockchain Circle has recently minted an additional 250 million USDC, according to ChainCatcher. Over the past month, Circle has minted a total of 10.5 billion USDC on the Solana blockchain. This development highlights Circle's ongoing activities in expanding its USDC supply on Solana. #Circle#USDC#Solana#Blockchain#Crypto#Stablecoin#Cryptocurrency#Minting#DeFi#CryptoNews#SOL

Crypto M - Crypto News

@CryptoM · Post #65198 · 11.04.2026 г., 20:45

🚀 USDC Treasury Mints 250 Million USDC Without Stated Reason A recent report from Whale Alert indicates that 250 million USDC has been minted at the USDC Treasury. According to NS3.AI, the report did not specify the reason behind this significant minting event. The lack of explanation has left market participants speculating about the potential implications for the cryptocurrency market. #USDC#Treasury#Cryptocurrency#WhaleAlert#Minting#NS3AI#MarketSpeculation

Crypto M - Crypto News

@CryptoM · Post #64729 · 09.04.2026 г., 16:16

🚀 USDC Treasury Mints 250 Million USDC A significant transaction was reported by Whale Alert, indicating that 250 million USDC was minted at the USDC Treasury. According to NS3.AI, this development could have implications for the stablecoin market, as such large minting activities often influence liquidity and market dynamics. The minting of USDC, a stablecoin pegged to the U.S. dollar, is closely monitored by market participants due to its potential impact on trading volumes and market stability. #USDC#Treasury#WhaleAlert#Stablecoin#Liquidity#MarketDynamics#Minting#TradingVolumes#MarketStability

Crypto M - Crypto News

@CryptoM · Post #65393 · 13.04.2026 г., 04:50

🚀 1 Billion DOT Minted and Sold on Ethereum and Polkadot Networks PeckShieldAlert posted on X that a significant amount of 1 billion DOT tokens were minted and subsequently sold on the Ethereum and Polkadot networks. This development has raised concerns within the cryptocurrency community regarding the potential impact on the market value of DOT tokens. The minting and selling activities were observed on both networks, highlighting the interconnected nature of blockchain platforms. The implications of this large-scale transaction are yet to be fully understood, as stakeholders assess the potential effects on the market dynamics of DOT. #1BillionDOT#Ethereum#Polkadot#cryptocurrency#marketimpact#PeckShieldAlert#blockchain#DOTtokens#crypto#minting#selling#marketdynamics

Venture Village Wall 🦄

@venturevillagewall · Post #3770 · 01.01.2025 г., 22:00

Telegram Unveils Major NFT Update 🎉 Telegram introduces a big update allowing gifts and stickers to be converted into NFTs. Gifts gain unique traits like emotions, backgrounds, and colors, enhancing their individuality and value. Rare traits will be limited to 10% of users, creating opportunities for resale at higher prices. Gifts can be converted for 25 Stars, while minting NFTs incurs network fees. Future integration with platforms like Fragment or GG is expected for seamless NFT creation. 🐸 The latest highlight is a unique frog gift gaining traction! For more details, visit: Full Update #Telegram#NFT#Gifts#Crypto#Updates#Blockchain#Stars#Minting#Fragment#GG#Frogs#RareItems#DigitalAssets#Community#Market#Trading#Tech#Innovation#SocialMedia#Engagement#CryptoTrends