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

Резултати

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

Пребарај: #chess

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

@proanalysistrader · Post #28386 · 14.01.2025 г., 10:02

#CHESS/USDT analysis : #CHESS is currently in an uptrend, consistently making higher highs (HHs) and higher lows (HLs), while finding support along the trendline. A breakout above the counter-trendline is anticipated, which will lead to a test of previous highs. TF : 1D Entry : $0.1945 Target : $0.2730 SL : $0.1586

Hashtags

Pro Analysis

@proanalysistrader · Post #27991 · 06.10.2024 г., 11:55

#CHESS/USDT analysis : #CHESS is currently going through a correction phase and retracing back to the 200 EMA before continuing its bearish move. The price is bouncing back from the support line and is expected to test the 200 EMA. TF : 1h Entry : $0.1358 Target : $0.1419 SL : $0.1315

Hashtags

American Crypto©

@americancryptotrading · Post #27249 · 15.05.2025 г., 09:17

🇺🇸#CHESS/USDT has retested the descendingresistance on the daily timeframe💁‍♂️ Looking for the rally to continue📈 American Crypto©

Hashtags

Fed. Russian Insiders ®

@FedRussianInsidersVip4Free · Post #6954 · 01.12.2025 г., 12:55

#CHESS (Binance Futures and Spot) ✅Sub $10 million market cap coin ✅Fully bottomed ✅Loking exactly like MYX at $1, before making a 1800% move to $18 CHESS is an easy 10x move, grabbing a big bag here below $0.05

Hashtags

Fed. Russian Insiders ®

@FedRussianInsidersVip4Free · Post #6952 · 01.12.2025 г., 12:17

LONGING $CHESS HERE Exchanges: Binance (Spot and Futures) #CHESS is not only a gem, it’s what we call a once in a lifetime trade. Fully bottomed, momentum stronger than anything we’ve seen, and an easy short term target at $0.25 - $0.5. Buy it below $0.045 while you can Entry: Below 0.045 Targets: 0.047 - 0.049 - 0.052 - 0.059 - 0.072 - 0.095 - 0.120 - 0.142 - 0.231 - OPEN SL: Below 0.034

Hashtags

Fed. Russian Insiders ®

@FedRussianInsidersVip4Free · Post #6900 · 22.11.2025 г., 16:34

BUYING $CHESS HERE Exchanges: Binance (Spot and Futures) The bottom is in for #CHESS Entry: Below $0.042 Targets: 0.045 - 0.048 - 0.052 - 0.60 - 0.74 - 0.108 - 0.132 - 0.172 - 0.210 - 0.281 - OPEN SL: Below $0.0335

Hashtags

Fed. Russian Insiders ®

@FedRussianInsidersVip4Free · Post #6661 · 24.09.2025 г., 15:08

LONGING $CHESS HERE Exchange: Binance / Binance Futures Leverage: 5-10x Fully bottomed and bullish momentum started. Buying #CHESS heavily here, easy 5x move🐋 Targets: 0.068 - 0.070 - 0.073 - 0.079 - 0.088 - 0.102 - 0.142 - 0.192 - 0.210 - OPEN SL: Below 0.053

Hashtags

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