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

Пребарај: #spotetf

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

@CryptoM · Post #64797 · 10.04.2026 г., 00:24

🚀 XRP Spot ETF Experiences Significant Outflow According to Odaily, data from SoSoValue indicates that on April 9, Eastern Time, the XRP spot ETF saw a net outflow of $661,200. The 21Shares XRP ETF (TOXR) was the only fund to experience this outflow, contributing to a historical total net outflow of $25.845 million. As of the time of reporting, the total net asset value of the XRP spot ETF stands at $955 million, with an XRP net asset ratio of 1.15%. The historical cumulative net inflow has reached $1.21 billion. #XRP#SpotETF#Outflow#Cryptocurrency#21Shares#TOXR#NetAssetValue#CryptoNews

Crypto M - Crypto News

@CryptoM · Post #65384 · 13.04.2026 г., 03:36

🚀 Ethereum spot ETFs saw net inflows of $187 million last week, with BlackRock's ETHA leading with $168 million in net inflows According to SoSoValue data, Ethereum spot ETFs recorded net inflows of $187 million during last week's trading sessions (April 6 to April 10, Eastern Time).The Ethereum spot ETF with the highest net inflows last week was BlackRock's ETF ETHA, with weekly net inflows of $168 million. Currently, ETHA's total historical net inflows have reached $11.73 billion. Following that was BlackRock's ETF ETHB, with weekly net inflows of $66.0015 million. Currently, ETHB's total historical net inflows have reached $377 million.The Ethereum spot ETF with the highest net outflows last week was Fidelity's ETF FETH, with weekly net outflows of $62.1274 million. Currently, FETH's total historical net inflows stand at $2.23 billion.As of the time of writing, the total net asset value of Ethereum spot ETFs is $12.96 billion. The ETF net asset ratio (market cap as a percentage of Ethereum's total market cap) has reached 4.76%, and the historical cumulative net inflows have reached $11.67 billion. #Ethereum#ETH#SpotETF#BlackRock#ETFA#ETHB#Fidelity#FETH#CryptoInvesting#NetInflows#MarketTrends

Venture Village Wall 🦄

@venturevillagewall · Post #4215 · 22.02.2025 г., 07:00

Bitcoin and Ethereum ETF Outflows Report On February 21, Bitcoin spot ETFs saw a net outflow of $62.77M, while BlackRock's ETF IBIT experienced a net inflow of $21.64M. Additionally, Ethereum spot ETFs recorded a net outflow of $8.92M. Read more here. #Bitcoin#Ethereum#ETF#Crypto#Investment#Finance#BlackRock#MarketTrends#Outflows#Inflows#FinanceNews#Blockchain#WuBlockchain#DigitalAssets#SpotETF#Cryptocurrency#Trading#MarketAnalysis#Funds#Assets

Venture Village Wall 🦄

@venturevillagewall · Post #3979 · 25.01.2025 г., 07:00

Bitcoin Holdings Shift to Large Investors CryptoQuant analysts reveal that since Trump's election, large investors have increased Bitcoin holdings from 16.2M to 16.4M BTC, while smaller investors reduced their assets from 1.75M to 1.69M BTC. Notably, January 24 saw Bitcoin spot ETF net inflows of $518 million, marking seven consecutive days of inflow, with Fidelity ETF leading at $186 million. Total net assets in Bitcoin spot ETFs now stand at $123.058 billion. #Bitcoin#ETF#Crypto#Investors#Finance#Market#Trends#Assets#Fidelity#SpotETF#Trading#Solana#AllianceDAO#Clout#Dapps#Technology#Innovation#News#Analytics#Quant