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

Резултати

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

Пребарај: #grt

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

@proanalysistrader · Post #28212 · 16.11.2024 г., 13:04

#GRT/USDT analysis : #GRT has broken out of its trendline with strong momentum following a bounce back from the support zone. The price is expected to maintain its bullish momentum and test previous highs. The current level presents a favorable entry opportunity. TF : 1W Entry : $0.2023 Target : $0.3446 and $0.4902 SL : $0.1450

Hashtags

Pro Analysis

@proanalysistrader · Post #28050 · 22.10.2024 г., 08:38

#GRT/USDT analysis : #GRT is currently in a downtrend, making lower lows (LLs) and lower highs (LHs), and is trading below the 200 EMA. The price is facing rejection from both the 200 EMA and the resistance zone. It is expected to decline from this point and potentially test the previous swing low. TF : 1D Entry : $0.1682 Target : $0.1294 SL : $0.1940

Hashtags

American Crypto©

@americancryptotrading · Post #27540 · 20.02.2026 г., 11:29

🇺🇸#GRT/USDT is ready to bounce from the lowerborder of the fallingwedge pattern on the weekly chart💁‍♂️ Looking for a move up on a bounce✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27323 · 26.07.2025 г., 08:29

🇺🇸#GRT/USDT is rebounding from the supportzone on the weekly chart🔍 More upside is likely📈 American Crypto©

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8731 · 14.03.2023 г., 18:31

#GRT Bullish 🚀🚀 https://www.binance.com/en/trade/GRT_BTC Buying Zone 600-625 Sitting on bottom.. bull run awaited Sell 🤑 700-740 🤑 740-800 🤑 800-860 🚀 860-900 & above Bullish above 585 Always use OCO after rising of Coin

Hashtags

Crypto

@signal_bitcoins · Post #2518 · 26.01.2024 г., 11:14

💰#GRT has a falling wedge pattern on 8H Time frame, we expec it will pump alot in the case of breakout, waiting now..⌛️ ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

Crypto

@signal_bitcoins · Post #2437 · 20.01.2024 г., 14:33

💰#GRT bounced back from the Support zone on 12H Time frame, we are waiting for breakup and pullback to the broken trendline 💫 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

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