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

Резултати

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

Пребарај: #cryptocurrency

当前筛选 #cryptocurrency清除筛选
The Hacker News

@thehackernews · Post #8826 · 18.04.2026 г., 08:00

Sanctioned #cryptocurrency exchange Grinex is shutting down after a $13.74M hack. Stolen funds were quickly moved and swapped to avoid freezing. The platform is linked to Garantex, flagged for laundering over $100M. 🔗 Read → https://thehackernews.com/2026/04/1374m-hack-shuts-down-sanctioned-grinex.html

🦅 [ perspective ix ]

@perspectiveix · Post #1281 · 20.05.2018 г., 19:30

​​💰With at least $1.3 billion invested globally in 2018, VC funding for blockchain blows past 2017 totals 🚀@PerspectiveIX Read more at t.me/iXNews/25659 Do you own any #CryptoCurrency? 👍🏻 Yes 😅 No, but I'm thinking of buying 👎🏻 No, not interested at all

DWF Labs Broadcast

@Dwflabs · Post #183 · 27.01.2023 г., 03:05

Fans of the TON #cryptocurrency now have a new way to trade their favorite altcoin following its addition to the options trading markets on the popular exchange platforms BIT and Paradigm. The options are live on the platform today and will be available on the institution-focused liquidity network Paradigm later, the exchange said in a statement shared with CoinDesk. The options are launched in collaboration with liquidity provider Darley Technologies and blockchain industry market maker and TON-backer DWF Labs. "Joining the options market is a logical and important step for TON because, until now, the only coins available there were BTC and ETH. It means TON will take its place alongside crypto's most prestigious coins," said Andrei Grachev, Managing Partner at DWF Labs. Full read here: https://lnkd.in/g6zACNN7

🗺 Travel the World | Private Expeditions

@expeditionsworldwide · Post #52 · 12.08.2020 г., 04:30

📊Intermediate statistics for the experimental portfolio: Days elapsed since launch: 20; Purchased 18 coins: #BTC #XRP #REP #EOS #NEO #STRAT #BSTX #OGN #ETC #ICX #LTC #CELR #QTUM #DASH #BEAM #LTO; Already Invested (since launch): $200 Total profit (since launch): 7.02% 📊Detailed portfolio statistics - https://bit.ly/30GlvN2 ➕FIBONACCI $10 Experiment (#cryptocurrency)

Trump's Ear

@trumpsear_tg · Post #1448 · 02.09.2025 г., 13:59

Trump earned more in cryptocurrency in a day than in real estate in his entire life - The Wall Street Journal On September 1, the WLFI token, another cryptocurrency issued by the Trump family, began trading on exchanges. The price of the token on the first day of trading fell by more than a third from its peak value, but despite this, the Trump fortune increased by more than $5 billion per day. This is much more than the value of all the real estate owned by Trump. #Trump#cryptocurrency 👂More on Trump's Ear ⚠️

TONlines – News

@tonlines · Post #7324 · 22.05.2025 г., 11:25

⚡️TON Community: Join the Ultimate TON NFT Gathering in Lisbon #TON#cryptocurrency TON Community announces an exclusive one-day event, TON of People, in Lisbon on June 5, 2025. The event will feature key figures from the TON blockchain and cryptocurrency communities, providing insights into NFTs and blockchain marketing. Attendees will also have access to additional events during the NFC Summit. Source: link @tonlines

TONlines – News

@tonlines · Post #6753 · 14.04.2025 г., 12:08

⚡️xRocket News: Real-Time Crypto Rates and Referral System #Telegram#cryptocurrency xRocket News introduces a new @xrocket dash command in Telegram that provides instant cryptocurrency rates and changes within chats. Users can also benefit from a built-in referral system by typing @xrocket dash followed by desired tokens. The rates automatically update every 30 minutes in larger groups or channels. Source: link @tonlines

DWF Labs Broadcast

@Dwflabs · Post #167 · 20.01.2023 г., 07:40

BIT x DWF Labs Crypto Snapshot [13 Jan] 📰 Highlights: 🔸Shanghai Upgrade Well On Track With Latest Testnet Developments 🔸#Bitcoin Rebounds From Its Lows Back To $21,000 🔸Innovation And Sound Practices Are Key For #Cryptocurrency Integration Full read here.

TONlines – News

@tonlines · Post #7055 · 05.05.2025 г., 16:22

Trending Apps: Discover TonTradingBot for Seamless Crypto Management #Cryptocurrency#Web3 Trending Apps highlights TonTradingBot, a comprehensive solution for crypto enthusiasts to manage trading operations directly within the chat. It offers features such as sniper mode, limit orders, and copy-trading, along with tools like Fast Swap and Honeypot Detection, promising secure and fast performance. Source: link @tonlines

123•••10•••20•••30•••40•••4344
ПретходнаСтраница 1 од 44Следна