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

Резултати

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

Пребарај: #financenews

当前筛选 #financenews清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #3975 · 24.01.2025 г., 19:00

Solana Stablecoin Market Surges 112% Stablecoin market cap on Solana skyrocketed 112% this year, reaching $10.8 billion. Solana is now the third-largest blockchain for stablecoins, behind Ethereum and TRON. Trading volume on Solana-DEX surpassed $220 billion, outpacing Ethereum's $69 billion. The growth was mainly driven by USDC issuance by Circle. Details here: ForkLog #Solana#USDC#Ethereum#TRON#Crypto#Blockchain#DEX#Stablecoins#Finance#Trading#Growth#MarketCap#Investments#FinanceNews #2025 #VC#AI

Venture Village Wall 🦄

@venturevillagewall · Post #4060 · 03.02.2025 г., 19:00

Kraken Expands Crypto Trading in Europe Kraken has secured an EU MiFID license through the acquisition of a Cypriot firm, enabling expansion of regulated crypto derivatives trading across European markets. This move aligns with increasing regulatory clarity in the crypto space. Read here! #Kraken#EU#Crypto#Derivatives#MiFID#Regulation#Trading#Market#Finance#CryptoNews#Blockchain#Investment#Innovation#Tech#Economy#FinanceNews#TechNews#VC#AI

Venture Village Wall 🦄

@venturevillagewall · Post #3902 · 17.01.2025 г., 10:00

Trump Prioritizes Crypto with New Executive Order Donald Trump is set to issue an executive order designating cryptocurrency as a national priority. The order will also establish an advisory council for the crypto industry, further highlighting the significance of digital currencies in U.S. policy. For more details, read the full article here. #Crypto#Trump#ExecutiveOrder#Bitcoin#AdvisoryCouncil#DigitalCurrency#Finance#Policy#US#Government#Blockchain#Investment#Innovation#Tech#Future#VC#FinanceNews#Cryptocurrency

Venture Village Wall 🦄

@venturevillagewall · Post #4077 · 05.02.2025 г., 19:00

BlackRock Launches Bitcoin ETP in Europe BlackRock, the largest asset manager globally, is set to launch an exchange-traded product (ETP) linked to Bitcoin in Europe. Marketing may start this month, marking BlackRock's first crypto-linked ETP outside North America. Read more #BlackRock#Bitcoin#ETP#Crypto#Finance#Investment#Europe#Assets#Market#Trade#Blockchain#News#Regulation#ETF#DigitalAssets#Wealth#Trading#Economy#Global#FinanceNews

Venture Village Wall 🦄

@venturevillagewall · Post #3933 · 20.01.2025 г., 22:00

SEC Chair Gensler Resigns; Bitcoin Surges 🇺🇸 SEC Chair Gary Gensler has officially resigned, causing ripples in the market. Bitcoin fluctuates around $103,000 to $104,000. Additionally, Solana’s Total Value Locked (TVL) exceeds $10B for the first time since the FTX collapse. 🔥 In other news, the Ethereum Foundation has established a multisig wallet, transferring 50,000 ETH for DeFi participation. Recent whale transfers: - 21,631 #WSOL ($5.39M) burned at an unknown wallet. - 1.62M #TRUMP ($67.39M) transferred between wallets. - 214,834 #SOL ($52.81M) also transferred between wallets. More on Ethereum’s new wallet Solana's TVL increase Whale Alert for TRUMP transfer Whale Alert for SOL transfer #Crypto#Bitcoin#SEC#Ethereum#SOL#DeFi#TRUMP#WhaleAlert#FTX#Finance#Market#FinanceNews#EthereumFoundation#TVL#Blockchain#Altcoins#Regulations#CryptoNews#Investments

Venture Village Wall 🦄

@venturevillagewall · Post #3925 · 20.01.2025 г., 01:00

Bitcoin Hits Record Highs Amid Trump Mania Bitcoin breaks records, surpassing $104,000. President-elect Trump credits "the Trump Effect" for the surge, emphasizing Bitcoin's resilience. The recently launched $MELANIA meme coin skyrocketed by 5330% within 40 minutes, indicating high demand. Whale activity noted with 50M USDC minted. Trading sentiment fluctuates wildly from pessimism to bullish as crypto markets respond to political news. More insights from Watcher Guru, Tree News, and Whale Alert. #Bitcoin#MELANIA#Trump#Crypto#USDC#WhaleAlert#Investing#Ethereum#Cryptocurrency#Memecoins#Finance#FinanceNews#MarketTrends#BullMarket#Altcoins#DeFi#Satoshi#MarketSentiment#Trading#RecordHighs

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 #3841 · 10.01.2025 г., 19:00

Usual Protocol Announces Key Adjustments Usual Protocol responds to user feedback with two significant changes: 1. Activation of a 1:1 early redemption feature starting next week. 2. Weekly revenue distributions to USUALx holders, with an estimated total of $5 million per month. Details can be found here. Additionally, Kenya prepares to legalize cryptocurrencies, marking a policy shift towards embracing digital assets Read more. #UsualProtocol#Cryptocurrency#Kenya#Crypto#Bitcoin#Blockchain#Finance#DeFi#Investment#Regulation#PolicyChange#Rewards#Earnings#DigitalAssets#Web3#Decentralization#Funding#Innovation#FinanceNews#VC

Venture Village Wall 🦄

@venturevillagewall · Post #4357 · 10.03.2025 г., 22:00

Crypto News: Market Decline and Developments 🇺🇸 Sunnyvale Public Safety Officers Association becomes the first U.S. dual-agency to hold Bitcoin on its balance sheet. Joseph Lubin praises U.S. government's reforms, anticipating crypto growth by 2025. President Trump's upcoming executive order may adjust Fed policies for crypto banks and clarify that stablecoins are not securities. FIFA considering a new cryptocurrency, FIFA Coin, to engage 5 billion fans. Coinbase to hire 1,000 workers, citing Trump's positive impact on the crypto industry. Ethereum sees significant outflows totaling $1.8 billion, while total value locked in DeFi drops to $88 million. Bitcoin's price fluctuates between extreme greed and fear, with a current value of $79,000. Ethereum declines below $2000, triggering market fears as total market cap falls by 33%. Current index shows extreme fear since 2022, affecting trader sentiments. #Bitcoin#Crypto#DeFi#TrumpsExecutiveOrder#FIFA#Ethereum#Coinbase#Stablecoins#MarketSentiment#Bullish#Blockchain#Investors#CryptoRegulation#ETH#USFinance#DigitalAssets#CryptoOutflows#FinanceNews

Venture Village Wall 🦄

@venturevillagewall · Post #4153 · 14.02.2025 г., 19:00

Citi Eyes Crypto Custody Expansion Citi is considering the addition of crypto custody services, indicating a growing interest in the digital asset space. Meanwhile, 60,045,505 #XRP, valued at 163,660,947 USD, was recently transferred between unknown wallets, according to Whale Alert. Read more: BBG #Citi#Crypto#XRP#Custody#WhaleAlert#Finance#DigitalAssets#Banking#Investment#Assets#Blockchain#Wallets#Market#News#Updates#FinanceNews#FinanceTech#WealthManagement#CustodyServices#DigitalCurrency

Venture Village Wall 🦄

@venturevillagewall · Post #3835 · 10.01.2025 г., 04:00

Russia to Sell Seized Bitcoin Assets The Russian Ministry of Finance plans to sell seized Bitcoin assets from the Infraud hacking case, starting with a batch valued at approximately $10 million. Marat Tambiev, a corrupt official, previously obtained 1,032.1 BTC from the hacker group. Read more here. #Bitcoin#Russia#Infraud#Crypto#DigitalAssets#Banking#Finance#Regulation#MiCA#Custody#StandardChartered#EU#Hacking#Seizure#MaratTambiev#CryptoNews#BTC#Blockchain#FinanceNews#News

12
ПретходнаСтраница 1 од 2Следна