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

Резултати

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

Пребарај: #multichain

当前筛选 #multichain清除筛选
Nomis | Onchain Reputation Protocol

@nomis_protocol · Post #557 · 29.11.2024 г., 14:05

Your once-a-year chance is here, little cryptos: 33% off all Nomis Scores minting, 50% cashback, and limited offers = Black Friday Mania! 🛍 JUMP ON THE 72H SALE --> 🔗nomis.cc How to make the most of your discounted Scores? The guide👇 1️⃣ TonHedge x Nomis – 10% Fee Discount 🔗Get Here Now 2️⃣ OmniBadge x Nomis – 300 Honors per user 🔗Get Here Now 3️⃣ Money Toon x Nomis – 500 OWP, SL Membership, 1 EGG with a chance to earn OWP, Automatic Mining 🔗Get Here Now 4️⃣ Hybrid Savings x Nomis – unique Black Friday offers! 🔗Get Here Now 5️⃣ DeGuard VPN x Nomis – Free DeGuard VPN annual plans to first 250 users! 🔗 Get Here Now 6️⃣ GVWS x Nomis – 5 winners share $125, another 50 receive 100 Nomis Emanations! 🔗Get Here Now What's the SMARTEST Black Friday move? ✍️ 💅 Utilize your #TON, #Linea, and #Multichain Scores for VIP shopping at MOSO! Black Friday comes once a year! Make it count 💜 Make your family proud 💠Nomis tApp | X | Discord | YouTube | Check Scores⚖️

TokenPocket

@tokenpocket_channel · Post #1009 · 14.12.2023 г., 10:17

🆕http://evm.ink now fully supports TokenPocket Wallet login and http://evm.ink is also listed on the TokenPocket #Inscriptions List! 👉https://www.tokenpocket.pro/ ​evmink is a #multichain#inscriptions indexer and marketplace. It has surpassed 270 million inscriptions and has more than 500,000 monthly unique wallet/visitors. Now users can explore #Inscription on ​BNBCHAIN, ​ethereum, and ​0xPolygonLabs. 👉https://evm.ink/ 【Details】https://twitter.com/TokenPocket_TP/status/1735241797901996541 【Powered By】Crypto Box

🎙THEFABLED Part 2 of our behind the scenes!⚔️ We’ve gotten a lot of questions about $ABYS, #NFTs, and being a #Multichain game with @XenumChain - This should help explain. 👉Follow up Twitter: https://twitter.com/thefablednft/status/1549792299889987584?s=20&t=AETnQwJZ6rmvm29_SIsIRw 👉Check out our team below, found on our Whitepaper! https://bit.ly/3RRTVon #Gaming#P2E#Cryptocurrency

TokenPocket

@tokenpocket_channel · Post #1145 · 25.01.2024 г., 04:17

🆕#DAppListing This week we've listed 12 DApps on ​TokenPocket_TP! 🔹@​ethereum: ​eigenlayer ​ether_fi ​Cindexfinance 🔹@​solana: Solrevoker ​GoPlusSecurity ​solendprotocol ​DriftProtocol 🔹#Multichain: Wizz Cash ​wizzwallet ​ShoebillFinance ​LayerBankFi ​ApertureFinance ​TrustaLabs ​Zeepr_labs 🔵All-in-one, All-in TokenPocket! 👉https://www.tokenpocket.pro/ 👉https://extension.tokenpocket.pro/#/ #restaking#Solana#Bitcoin#MANTA#Arbitrum#EOSEVM 【Details】https://twitter.com/TokenPocket_TP/status/1750371718290702363 【Powered By】Crypto Box

ChainDoctor 频道

@ChainDoctor · Post #36 · 19.01.2022 г., 08:13

#Anyswap#MultiChain Urgent notice from Multichai (formerly AnySwap) #WETH , #PERI , #OMT , #WBNB , #MATIC , #AVAX 6 tokens were found to be vulnerable If you approve, you need to connect to here ( https://app.multichain.org/#/approvals ) to cancel. 如果你曾经在anyswap使用过这六个代币跨链,那么请点击https://app.multichain.org/#/approvals ,并取消授权。已经有个人账户被攻击导致资金损失。

Crypto M - Crypto News

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

🚀 TRON Network Implements Proposal 106 to Enhance Compatibility TRON Network has officially passed Proposal 106 as of April 10 at 20:00 UTC+8. According to ChainCatcher, the mainnet has adjusted the behavior and execution cost of the SELFDESTRUCT instruction. Contracts will only be permanently removed from the blockchain if the instruction is called within the same transaction as the contract's creation. Otherwise, executing the instruction will merely transfer the assets within the contract to a specified address, without deleting the contract itself. Additionally, the energy consumption for SELFDESTRUCT has been changed from 0 to 5000. This adjustment aligns TRON's mechanisms more closely with Ethereum, enhancing the compatibility of the TRON Virtual Machine (TVM). It aims to provide more stable foundational support for multi-chain development and ecosystem adaptation. #TRON#Proposal106#Blockchain#Ethereum#TVM#SELFDESTRUCT#Mainnet#MultiChain#Ecosystem#Crypto#ETH#TRX