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

Резултати

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

Пребарај: #rif

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

@proanalysistrader · Post #28216 · 17.11.2024 г., 06:24

#RIF/USDT analysis : Following a significant decline of -83% from its all-time high, the price has found support at the $0.0600 level. Subsequently, it has bounced back and successfully broken above the trendline, indicating a confirmation of anticipated bullish momentum. It is expected that the price will continue this upward trajectory and test the previous swing high. TF : 1W Entry : $0.1117 Target : $0.3377 SL : $0.0766

Hashtags

Pro Analysis

@proanalysistrader · Post #27951 · 22.09.2024 г., 03:30

#RIF/USDT analysis : #RIF is trading above the support zone and the 200 EMA. The price is anticipated to rebound from this level and proceed to rise, testing the previous swing high. TF : 15min Entry : $0.0977 Target : $0.1007 SL : $0.0956

Hashtags

Alphavave Traders ️️️

@alphavave · Post #3256 · 21.04.2026 г., 00:34

#RIF yielded an impressive 3,010% return in a few days ⭐ If you used 200x leverage on this signal, you would've made a mind-blowing profit of 12,040%🤩 $50💰 would return $750💵 $50 💰 would return $1,500 💲 $50💰 would return $6,000💰 When you understand the market like we do, every move becomes predictable With 5+ years of trading experience, we spot these moves before they happen 💯 If you want daily signals like this, DM me to join our private group! 👇 @Kevindexter✅

Hashtags

Binance crypto champions

@binancecryptochampions · Post #3087 · 11.02.2026 г., 03:39

💎#RIF/USDT 💎 Signal Type: Regular (Long) Leverage: Cross (20.0x) Amount: 2.0% Entry Targets: 1) 0.04535 Take-Profit Targets: 1) 0.04635 2) 0.04800 3) 0.05065 Stop Targets: 1) 0.04250 🦋 Published by: @Trading_exp🦋 Join_vip: @Crypto_Futures_Spot_Payment_bot 🚫 Don't forget to Secure profit 🚫

Hashtags

Alex Kowalski | Trade

@kowalskitrade · Post #751 · 12.09.2024 г., 16:13

#RIF I'm expecting roughly this kind of movement on this asset, either with streaming start ups behind our magnets from above. 📈Sign up on Bybit to trade with me

Hashtags

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