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

Резултати

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

Пребарај: #dusk

当前筛选 #dusk清除筛选
Pro Analysis

@proanalysistrader · Post #28530 · 10.03.2025 г., 16:34

#DUSK/USDT analysis : #Dusk is currently in a downtrend and making new lows. The price has broken below support and is anticipated to resume bearish momentum and test lower levels. Wait for a retest of the broken support for a short entry opportunity. TF : 1D Entry : $0.1062 Target : $0.0730 SL : $0.1280

Hashtags

Pro Analysis

@proanalysistrader · Post #28133 · 07.11.2024 г., 16:45

#DUSK/USDT analysis : #DUSK is currently attempting to break through the trendline and rise higher to test the previous swing high. The price has formed a double bottom pattern within the support zone, which further indicates the potential for upcoming bullish momentum. It is advisable to wait for the price to break the trendline before considering a long entry. TF : 1D Entry : $0.1910 Target : $0.2520 SL : $0.1508

Hashtags

Crypto Headlines

@market_headlines · Post #27923 · 24.03.2026 г., 10:34

😳#DUSK +60% за 3 дня! Dusk — Layer-1 блокчейн с Zero-Knowledge proofs (ZK-SNARKs) для полной приватности транзакций и смарт-контрактов. Поддерживает конфиденциальную токенизацию реальных активов (RWA), DeFi и торговлю с встроенной регуляторной совместимостью (MiFID II, MiCA). Токен доступен: MEXC Crypto Headlines

Hashtags

Pro Analysis

@proanalysistrader · Post #27895 · 01.09.2024 г., 11:11

#DUSK/USDT analysis : #DUSK is currently consolidating within a channel. The broader trend on larger timeframes suggests a bearish outlook, indicating a possible breakout from the channel to further descend towards lower price levels. It is recommended to await a breakout from the channel and a drop below the $0.1932 level before considering entering a short position. TF : 4H Entry : $0.1932 Target : $0.1508 SL : $0.2195

Hashtags

American Crypto©

@americancryptotrading · Post #27070 · 02.12.2024 г., 16:46

🇺🇸#DUSK/USDT showing descending resistance breakout on 3-day timeframe🧐 Bullish case✈️ American Crypto©

Hashtags

Free Crypto Signals (Profitable Zone)

@btctradingclub · Post #26771 · 14.01.2026 г., 12:43

🚀🚀 20% Profit on #DUSK/USDT for our Premium Members on Binance Futures/Bybit/OKXX/Kucoin/Bitget ✅✅ All target completed 👁‍🗨Contact @primemod to enter the Premium Group for high quality SPOT & FUTURES Signals

Hashtags

Free Crypto Signals (Profitable Zone)

@btctradingclub · Post #26285 · 08.11.2025 г., 09:58

🚀🚀 525%+ Huge Profit on #DUSK/USDT as it has hit all the profit target with great easiness - The trade has been closed today 👁‍🗨Contact @primemod to enter the premium group & make daily gains

Hashtags

Free Crypto Signals (Profitable Zone)

@btctradingclub · Post #26282 · 07.11.2025 г., 15:08

🚀🚀 590%+ Huge Profit on #DUSK/USDT as it has hit all the profit target with great easiness - The trade has been closed today 👁‍🗨Contact @primemod to enter the premium group & make daily gains

Hashtags

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