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

Резултати

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

Пребарај: #ksm

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

@CoinSonar · Post #243761 · 17.04.2026 г., 15:57

#KSM | Volume spike (USDT PAIR) 23 times the average volume 132.18K USDT traded in 15 min └Buying vol: 73.87K USDT 🟢 Boost score: 4/10 24h Vol: 540.16K USDT (Binance) Price: 5.00 (-0.9% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243692 · 17.04.2026 г., 13:39

#KSM | Volume spike (USDT PAIR) 22 times the average volume 128.88K USDT traded in 15 min └Buying vol: 87.91K USDT 🟢 Boost score: 3/10 24h Vol: 540.16K USDT (Binance) Price: 5.14 (-0.9% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243621 · 17.04.2026 г., 11:38

#KSM | Volume spike (USDT PAIR) 24 times the average volume 137.73K USDT traded in 15 min └Selling vol: 82.17K USDT 🔴 Boost score: 1/10 24h Vol: 540.16K USDT (Binance) Price: 5.17 (-0.9% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243576 · 17.04.2026 г., 09:38

#KSM | Volume spike (USDT PAIR) 34 times the average volume 196.20K USDT traded in 15 min └Selling vol: 115.52K USDT 🔴 Boost score: 1/10 24h Vol: 540.16K USDT (Binance) Price: 5.27 (-0.9% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243506 · 17.04.2026 г., 07:38

#KSM | Volume spike (USDT PAIR) 135 times the average volume 254.11K USDT traded in 5 min └Selling vol: 146.21K USDT 🔴 Boost score: 1/10 24h Vol: 540.16K USDT (Binance) Price: 5.69 (-0.9% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243462 · 17.04.2026 г., 05:38

#KSM | Volume spike (USDT PAIR) 22 times the average volume 129.23K USDT traded in 15 min └Buying vol: 80.41K USDT 🟢 Boost score: 5/10 24h Vol: 540.16K USDT (Binance) Price: 4.73 (-0.9% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28194 · 14.11.2024 г., 16:17

#KSM/USDT analysis : #KSM has broken below the 200 EMA and is currently attempting to breach the support zone. The price is expected to break through this zone and continue its decline. For a short entry, it is recommended to wait for confirmation of the support break. TF : 1h Entry : $17.86 Target : $16.78 SL : $18.54

Hashtags

Pro Analysis

@proanalysistrader · Post #27941 · 17.09.2024 г., 13:30

#KSM/USDT analysis : #KSM is in an uptrend, trading above the 200 EMA. The price has tested and bounced back from the 200 EMA and the support zone. It is likely to continue its bullish momentum and test previous highs. TF : 2H Entry : $19.90 Target : $21.77 SL : $18.82

Hashtags

Pro Analysis

@proanalysistrader · Post #27876 · 26.08.2024 г., 05:38

#KSM/USDT analysis : #KSM is presently consolidating within the resistance zone and is anticipated to decline from this point to retest previous lows. TF : 1h Entry : $22.03 Target : $20.50 SL : $22.93

Hashtags

ПретходнаСтраница 1 од 4Следна