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

Резултати

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

Пребарај: #altcoins

当前筛选 #altcoins清除筛选
Coin Signals

@coin_signals · Post #16875 · 11.08.2025 г., 19:28

📊 There is no strength in the market; very few coins have posted double-digit returns in the past 7 days. First, LTC pumped, then ETH, and then BTC. The overall market is not trending upward together. (possibility of exit pumps) $BTC Bullish if holds above $121k. $ETH Bullish Right Now #Altcoins still Bearish.

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4828 · 13.09.2024 г., 10:18

The markets are heating up for a strong October and November. That's why you want to be positioned into strong #Altcoins. $OM is one of them, only 24% down from the ATH, it's looking primed for a strong continuation in upcoming months.

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4824 · 12.09.2024 г., 10:26

#Altcoins are doing relatively well. $SEI continues to find momentum, and I'd like to see it rally to $0.34 (preferably even above the previous high, but not expecting that yet), make an HL, and continue that rally to $0.44 in October.

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4795 · 09.09.2024 г., 13:30

#Altcoins are doing great, silently. $OP has been gaining momentum, up 28% since the recent low. Rounded bottom with a 3-day bullish divergence. Needs to break through 2750-2850 sats, and then the divergence becomes valid. Expecting a big breakout.

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4789 · 08.09.2024 г., 10:40

The #Altcoins show a potential bullish divergence on the Others/BTC chart. Very important, as that might be an indicator of what's going to come. The bottoming process is fully in place.

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4787 · 07.09.2024 г., 16:08

Ethereum #altcoins aren't doing bad, as $OP is currently up from the lows. However, on the larger scale, it's currently down substantially and it's back to the lows. I'm expecting a lot more upside to come on this one once EigenLayer comes into action.

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4776 · 06.09.2024 г., 16:52

#Altcoins aren't doing that wrong, as $SEI is currently looking at a crucial support test. I'd like to see $SEI stay above $0.24. If that's the case, we'll be good to go towards $0.45.

Hashtags

123•••10•••20•••2526
ПретходнаСтраница 1 од 26Следна