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

Пребарај: #nansen

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

@CryptoM · Post #64891 · 10.04.2026 г., 07:14

🚀 Ethereum and Chainlink Whales Accumulate Ahead of U.S. CPI Release According to NS3.AI, recent data from Santiment reveals that Ethereum whale wallets have accumulated 500,000 ETH, valued at approximately $1.09 billion, just before the release of the U.S. Consumer Price Index (CPI). In a similar move, Chainlink whale wallets have added 1.89 million LINK, worth about $16.93 million. Meanwhile, Nansen data indicates that Uniswap whale wallets have reduced their holdings by 2.48% over the past week, equivalent to around 90,000 UNI, as traders brace for potential volatility in response to the upcoming inflation report. #Ethereum#Chainlink#Whales#CPI#Uniswap#ETH#LINK#UNI#Inflation#Santiment#Nansen

Venture Village Wall 🦄

@venturevillagewall · Post #4197 · 20.02.2025 г., 07:00

AI Infrastructure Opportunities Emerging! New potential for large-scale AI infrastructure projects! 🤖🔗 While fears of AI replacing humans persist, the reality shows a need for collaboration. Specialized platforms are essential for this interaction. Check out inspirations for creating your own platform here. Additionally, Nansen analysts report that 15,431 wallets experienced significant profit/loss on LIBRA: 86% lost $251M, while a few gained $180M. Recent crypto updates: BTC ETF outflow: $64M, ETH ETF inflow: $19M. During the last 24 hours, 74K traders were liquidated, totaling $139M. Largest liquidation: ETH/USDT at $2M on Binance. #AI#Crypto#VC#Blockchain#Investment#Finance#Tech#DataScience#MarketTrends#Nansen#Wallets#LIBRA#BTC#ETH#Liquidation#ETFs#ProfitLoss#Infrastructure#Innovation#DigitalEconomy#Trading

Venture Village Wall 🦄

@venturevillagewall · Post #4198 · 20.02.2025 г., 10:00

Traders Face Major Losses with LIBRA Coin Nansen research reveals that 86% of LIBRA coin traders lost money, totaling $251 million in investor losses. Meanwhile, insiders profited over $100 million from the token issuance. For more details, visit CoinDesk. #LIBRA#Argentina#Crypto#Investors#Losses#Trading#Nansen#Market#Finance#Tokens#Wealth#Volatility#DeFi#Research#Blockchain#Memecoin#VC#Funds#Loss#Insiders#TradingStrategy

Venture Village Wall 🦄

@venturevillagewall · Post #3837 · 10.01.2025 г., 10:00

Alternatives vs. Altcoin Market Perspectives 🔍 CEO of CryptoQuant, Ki Yun Joo, labels the altcoin market as a 'zero-sum game' due to stagnant capital influx. He suggests only projects with robust use cases can survive. 🚀 Citi analysts forecast a potential alt season with Trump's return, benefiting Ethereum through ETF capital rotation. 📊 Nansen integrates TON blockchain data, offering real-time metrics for the Web3 ecosystem. 💰 CleanSpark becomes the fourth public miner with over 10,000 BTC, reaching this milestone by mining directly. 📈 Ripple aims to list its new RLUSD stablecoin on major exchanges, including ongoing talks with Coinbase and Binance. Bitstamp recently announced support for RLUSD. #Altcoins#Crypto#Ethereum#ETFs#TON#Web3#CleanSpark#Bitcoin#Ripple#RLUSD#Citi#CryptoQuant#Nansen#Blockchain#Mining#Exchange#Bitstamp#CapitalRotation#AltSeason#DonaldTrump#DataAnalytics

Crypto M - Crypto News

@CryptoM · Post #65295 · 12.04.2026 г., 15:15

🚀 Crypto Analyst Manya Releases Research Tool Rankings Crypto analyst manya has released a ranking of personal research tools. According to ChainCatcher, the rankings categorize tools into different levels based on their effectiveness. The S-tier includes Dune and frontrun.pro, while the A-tier features Coinglass, RootData, Drop, MetaSleuth, and DefiLlama. B-tier tools comprise Arkham, Bubblemaps, Dexscreener, Surf, Nansen, and CoinMarketCap. C-tier tools include Cryptorank and others. #CryptoAnalyst#ResearchTools#CryptoRanking#Dune#frontrunpro#Coinglass#RootData#Drop#MetaSleuth#DefiLlama#Arkham#Bubblemaps#Dexscreener#Surf#Nansen#CoinMarketCap#Cryptorank