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

Резултати

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

Пребарај: #powr

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

@proanalysistrader · Post #28382 · 11.01.2025 г., 13:30

#POWR/USDT analysis : #POWR has successfully broken above the trendline and is anticipated to continue its upward movement, with the potential to test previous highs. This breakout signals a bullish trend, suggesting further price appreciation in the near term. TF : 1D Entry : $0.3090 Target : $0.4500 SL : $0.2270

Hashtags

Pro Analysis

@proanalysistrader · Post #28307 · 04.12.2024 г., 08:45

#POWR/USDT analysis : #POWR is currently in an uptrend, trading above the 200 EMA. The price has bounced back from the support zone with strong volume. As a result, we can expect the price to maintain its bullish momentum and test higher levels. TF : 2H Entry : $0.3500 Target : $0.4200 SL : $0.3022

Hashtags

Pro Analysis

@proanalysistrader · Post #27824 · 09.08.2024 г., 17:35

#POWR/USDT analysis : #POWR is in a correction phase and has recently tested the resistance zone near the 200 EMA. The price is anticipated to be rejected from there and continue its downward direction. Wait for the break of the $0.1936 level for entry. TF : 4H Entry : $0.1936 Target : $0.1751 SL : $0.2058

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #15811 · 13.02.2024 г., 14:43

⚡️⚡️#POWR/USDT ⚡️⚡️ Exchanges: Binance Futures Signal Type: Regular (Long) Leverage: Cross (50х) Entry Targets: 0.3596 Take-Profit Targets: 1)0.365 2)0.3686 3)0.3722 4)0.3776 5)0.3812 6)0.3866 7) 🚀🚀🚀 Stop Targets: 5-10% By Crypto Australia

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #9037 · 28.07.2024 г., 07:15

#POWR👈 https://www.binance.com/en/trade/POWR_BTC Buy at current 320-335 Highly pumpable Coin on the brink of 🚀 Buy in parts 👈strictly follow for max profits as its pump coin Sell 🤑360-380 🤑380-410 🤑 410-440 🤑 440-470 🚀 470- 500 & above Bullish above -300

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #9016 · 12.05.2024 г., 12:05

#POWR👈 https://www.binance.com/en/trade/POWR_BTC Buy at current 485-495 Highly pumpable Coin on the brink of 🚀 Buy in parts 👈strictly follow for max profits as its pump coin Sell 🤑520-550 🤑 550-600 🤑 600-650 🤑 650-700 🚀 700- 750 & above Bullish above -470

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8850 · 16.09.2023 г., 17:59

#POWR👈 https://www.binance.com/en/trade/POWR_BTC Buy at current 525-540 Highly pumpable Coin on the brink of 🚀 Buy in parts 👈strictly follow for max profits as its pump coin Sell 🤑 570-600 🤑 600-650 🤑 650-700 🚀 700- 750 & above Bullish above -510

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8797 · 19.05.2023 г., 16:40

#POWR👈 https://www.binance.com/en/trade/POWR_BTC Buy at current 605-610 Highly pumpable Coin on the brink of 🚀 Buy in parts 👈strictly follow for max profits as its pump coin Sell 🤑 640-670 🤑 670-730 🤑 730-790 🚀 790- 850 & above Stop Loss/Exit -590

Hashtags

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