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

Резултати

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

Пребарај: #ogn

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

@CoinSonar · Post #243848 · 17.04.2026 г., 21:36

#OGN | Volume spike (USDT PAIR) 119 times the average volume 109.63K USDT traded in 5 min └Buying vol: 74.11K USDT 🟢 Boost score: 7/10 24h Vol: 263.92K USDT (Binance) Price: 0.0243 (-1.7% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243729 · 17.04.2026 г., 15:04

#OGN | Volume spike (USDT PAIR) 523 times the average volume 95.96K USDT traded in 1 min └Buying vol: 65.78K USDT 🟢 Boost score: 8/10 24h Vol: 263.92K USDT (Binance) Price: 0.0246 (-1.7% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243481 · 17.04.2026 г., 06:30

#OGN | Volume spike (USDT PAIR) 117 times the average volume 107.72K USDT traded in 5 min └Buying vol: 66.46K USDT 🟢 Boost score: 5/10 24h Vol: 263.92K USDT (Binance) Price: 0.0236 (-1.7% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28527 · 08.03.2025 г., 16:29

#OGN/USDT analysis : #OGN is currently in a downtrend, trading below the 200 EMA. The price has broken and retested the support zone, suggesting a continuation of the bearish momentum and a potential drop to lower levels. For short entry, look for a pullback. TF : 2H Entry : $0.0653 Target : $0.0600 SL : $0.0690

Hashtags

Pro Analysis

@proanalysistrader · Post #28345 · 17.12.2024 г., 13:33

#OGN/USDT analysis : #OGN is in an uptrend, making higher highs (HHs) and higher lows (HLs) above the 200 EMA. Currently, it’s consolidating over the 200 EMA, which suggests a potential bounce back and continuation of the bullish momentum. Watch for a breakout above the $0.1460 level to enter a long position, as this will lead to testing previous highs. TF : 4H Entry : $0.1460 Target : $0.1700 SL : $0.1300

Hashtags

Pro Analysis

@proanalysistrader · Post #28281 · 28.11.2024 г., 15:03

#OGN/USDT analysis : #OGN is currently in a downward slope, consistently forming lower lows (LLs) and lower highs (LHs). The price is anticipated to continue its bearish momentum and may test the previous swing low. TF : 15min Entry : $0.1242 Target : $0.1201 SL : $0.1270

Hashtags

Pro Analysis

@proanalysistrader · Post #27933 · 14.09.2024 г., 15:14

#OGN/USDT analysis : #OGN has broken out above previous highs and the 200 EMA, currently finding support above these levels. The price is expected to bounce off from this support and continue its bullish momentum to test previous highs. TF : 1H Entry : $0.0854 Target : $0.0937 SL : $0.0800

Hashtags

American Crypto©

@americancryptotrading · Post #27300 · 03.07.2025 г., 08:44

🇺🇸#OGN/USDT is printing the descendingresistance line on the daily timeframe👨‍💻 A breakout is coming✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27118 · 12.01.2025 г., 17:04

🇺🇸#OGN/USDT is consolidating within the descendingtriangle on the weekly chart🧐 Looking for a leg upwards✈️ American Crypto©

Hashtags

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