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

Резултати

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

Пребарај: #bch

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

@CoinSonar · Post #243359 · 16.04.2026 г., 23:33

#BCH | Volume spike (USDT PAIR) 62 times the average volume 298.52K USDT traded in 1 min └Buying vol: 217.59K USDT 🟢 Boost score: 6/10 24h Vol: 6.91M USDT (Binance) Price: 455.2 (-1.8% in 24h)

Hashtags

American Crypto©

@americancryptotrading · Post #27574 · 31.03.2026 г., 09:39

🇺🇸#BCH/USDT is about to break through the ascendingtriangle on the 2W timeframe👀 Bullish📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27492 · 05.01.2026 г., 09:52

🇺🇸#BCH/USDT is currently trading above the symmetrical triangle formation on the 2W timeframe👨‍💻 Looking for a rise🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27446 · 22.11.2025 г., 16:18

🇺🇸#BCH Bitcoin Cash is pressing against the upper boundary of the macro ascending channel on the weekly timeframe 📈 Price continues to build higher lows while grinding toward resistance — a classic sign of strength inside a rising structure. Once BCH breaks through the channel top, momentum can accelerate sharply, opening the door for a major continuation move 🚀 The chart is bullish — BCH is preparing for the next expansion leg. American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27403 · 11.10.2025 г., 10:40

🇺🇸#BCH/USDT is consolidating above the symmetricaltriangle pattern on the weekly chart💁‍♂️ The bullish outlook remains intact🚀 American Crypto©

Hashtags

Free Crypto Signals (Profitable Zone)

@btctradingclub · Post #26960 · 22.02.2026 г., 09:58

🔰#BCH Update - Price is pushing higher after the recent bounce. Keeping a close watch on $603, which remains a key upside target on this leg up, as it aligns with the yearly open — a significant level that often acts as strong resistance.

Hashtags

Free Crypto Signals (Profitable Zone)

@btctradingclub · Post #26416 · 24.11.2025 г., 12:01

✅✅ 30% Profit on #BCH/USDT for our Premium Members on Binance Futures/Bybit/OKX & KuCoin 👁‍🗨Contact @primemod to enter the premium group & make daily gains on Futures/Bybit/OKX/Kucoin & Bitget market

Hashtags

Free Crypto Signals (Profitable Zone)

@btctradingclub · Post #26415 · 24.11.2025 г., 08:40

✅✅ 38% Profit on #BCH/USDT for our Premium Members on Binance Futures/Bybit/OKX & KuCoin 👁‍🗨Contact @primemod to enter the premium group & make daily gains on Futures/Bybit/OKX/Kucoin & Bitget market

Hashtags

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