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

Резултати

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

Пребарај: #atom

当前筛选 #atom清除筛选
Coin Sonar

@CoinSonar · Post #243622 · 17.04.2026 г., 11:40

#ATOM | Volume spike (USDT PAIR) 9 times the average volume 245.89K USDT traded in 15 min └Buying vol: 173.79K USDT 🟢 Boost score: 4/10 24h Vol: 2.44M USDT (Binance) Price: 1.824 (-4.0% in 24h)

Hashtags

Crypto Headlines

@market_headlines · Post #28169 · 03.04.2026 г., 09:16

🔠#ATOM Leap Wallet, криптокошелек экосистемы Cosmos, прекратит свою работу 28 мая 2026 года – анонс Ранее: DMAIL Network Crypto Headlines

Hashtags

Pro Analysis

@proanalysistrader · Post #27848 · 17.08.2024 г., 11:16

#ATOM/USDT analysis : #ATOM is currently moving up while finding support over the trendline. It has also broken out above the 200 EMA on the lower timeframes. The price is expected to continue its momentum and test previous highs. TF : 15min Entry : $4.613 Target : $4.675 SL : $4.567

Hashtags

Pro Analysis

@proanalysistrader · Post #27692 · 22.06.2024 г., 05:03

#ATOM/USDT analysis - #ATOM is in a downtrend, making new lows while trading below the 200 EMA. The price is currently rejecting from the resistance zone and expected to decline from there, continuing its bearish momentum. Aim for the previous swing low as the target level. TF : 1h Entry : $6.758 Target : $6.216 SL : $7.131

Hashtags

American Crypto©

@americancryptotrading · Post #27610 · 05.05.2026 г., 09:17

🇺🇸#ATOM/USDT is consolidating above the lowerboundary of the descendingchannel pattern on the weekly timeframe👀 Market recovery is underway🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27550 · 02.03.2026 г., 11:04

🇺🇸#ATOM/USDT has found support at the lowerborder of the descendingchannel pattern on the weekly chart👨‍💻 Looks bullish🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27500 · 12.01.2026 г., 10:22

🇺🇸#ATOM/USDT has bounced from the support at the lowerboundary of the descendingchannel on the weekly chart🔍 Accumulate here✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27394 · 02.10.2025 г., 09:05

🇺🇸#ATOM/USDT is facing the supportzone on the weekly chart🔍 Further upside possible after bounce🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27328 · 31.07.2025 г., 10:20

🇺🇸#ATOM/USDT is testing the supportzone on the weekly chart🧐 Looking for a bounce and rally🐃 American Crypto©

Hashtags

123•••1011
ПретходнаСтраница 1 од 11Следна