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

Резултати

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

Пребарај: #nysearca

当前筛选 #nysearca清除筛选
NEWS 鏈新聞-ABMedia

@abmedia_news · Post #24203 · 28.04.2026 г., 14:44

【📜 政策監理|NYSE Arca 提案加密 ETF 85% 合格資產門檻:BTC、ETH、SOL、XRP 過關】 NYSE Arca 向 SEC 提交 SR-NYSEARCA-2026-42,要求加密 ETF 信託至少 85% NAV 為合格資產(商品、商品衍生資產、證券、現金)。BTC、ETH、SOL、XRP 因有 6 個月期貨紀錄符合資格,OTC 選擇權與 NFT 排除。Nasdaq 同步提出對應規則 5711(d)。 #SEC#加密ETF#NYSEArca 📍閱讀全文: https://abmedia.io/sec-nyse-arca-85-percent-eligible-asset-rule-crypto-etf

Crypto M - Crypto News

@CryptoM · Post #64678 · 09.04.2026 г., 13:49

🚀 Morgan Stanley's Bitcoin Trust Launches with Strong Inflows on NYSE Arca Morgan Stanley's Bitcoin Trust (MSBT) made its debut on the NYSE Arca on Wednesday, attracting $30.6 million in first-day inflows and generating approximately $34 million in trading volume. According to NS3.AI, as of April 8, MSBT held 444.4 Bitcoin, valued at around $31.7 million, and offered the lowest fee among U.S. spot Bitcoin ETF competitors. This marks the first spot Bitcoin ETF launched by a U.S. bank. On the same day, BlackRock's IBIT led with $40 million in inflows. Data from Farside indicates that total net outflows across U.S. spot Bitcoin ETFs amounted to $124.5 million on Wednesday. #Bitcoin#ETF#MorganStanley#NYSEArca#Cryptocurrency#Finance#Investment#BlackRock#CryptoMarket#SpotBitcoin#BTC

Crypto M - Crypto News

@CryptoM · Post #65324 · 12.04.2026 г., 23:11

🚀 Bitwise Amends Spot Hyperliquid ETF Proposal with SEC Bitwise Asset Management has submitted a second amendment for its proposed spot Hyperliquid ETF to the U.S. Securities and Exchange Commission as of April 10. According to NS3.AI, the amendment outlines a 0.67% annual management fee and introduces Flowdesk and Wintermute as approved HYPE trading counterparties, while removing A1 from the list. Anchorage Digital Bank remains the custodian for the fund. The ETF is set to trade on NYSE Arca under the ticker BHYP, with plans to stake the majority of its HYPE holdings while maintaining a 30% liquidity reserve for redemptions. #Bitwise#AssetManagement#HyperliquidETF#SEC#Amendment#ManagementFee#Flowdesk#Wintermute#A1#AnchorageDigitalBank#NYSEArca#BHYP#HYPE#LiquidityReserve#Redemptions