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

Резултати

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

Пребарај: #decisionintelligence

当前筛选 #decisionintelligence清除筛选
EdgeMarket.AI 📣

@edgemarketai · Post #7992 · 21.02.2026 г., 09:36

Most systems try to predict outcomes. EdgeMarket focuses on something more fundamental: structure. Our AI ingests real-world events — political decisions, cultural moments, sports fixtures, institutional deadlines — and turns them into time-aware signals. Not opinions. Not hype. Just structured context that shows where pressure is building and when it matters. That’s how uncertainty becomes understandable. Explore how EdgeMarket uses AI as infrastructure, not guesswork 👉https://edgemarket.ai #AI#DecisionIntelligence#EdgeMarket#SignalsOverNoise

EdgeMarket.AI 📣

@edgemarketai · Post #8001 · 22.02.2026 г., 10:52

Will BTS’ March album pre-orders exceed 6,000,000 by Feb 28? At this scale, outcomes don’t appear suddenly — they form through visible signals long before confirmation. EdgeMarket tracks how expectations converge. Hashtags: #BTS#MarketSignals#DecisionIntelligence#EdgeMarket#DataDriven#CulturalTrends

EdgeMarket.AI 📣

@edgemarketai · Post #7991 · 20.02.2026 г., 10:35

High-profile matches expose more than skill — they reveal system dynamics. For Nottingham Forest vs Liverpool, EdgeMarket analyzes scenario formation: • Momentum vs control • Tactical flexibility • Fatigue and recovery cycles • Pressure response under crowd intensity Rather than framing outcomes as binary, we focus on how probabilities evolve before and during the match. Sport is one of the clearest real-world laboratories for decision intelligence. #DecisionIntelligence#SportsAnalytics#PremierLeague#EdgeMarket#SystemsThinking#OutcomeAnalysis

EdgeMarket.AI 📣

@edgemarketai · Post #8026 · 10.03.2026 г., 08:20

Geopolitical questions rarely move markets when they become obvious. They move when probability starts shifting before formal signals appear. That is why prediction systems matter. Not because they claim certainty, but because they surface how conviction changes while narratives are still forming. At EdgeMarket, we study how distributed judgement reacts to emerging geopolitical scenarios long before consensus hardens. The important signal is rarely the headline itself. It is how probability changes before the headline arrives. #EdgeMarket#PredictionMarkets#Geopolitics#AI#MarketIntelligence#Decentralization#GlobalRisk#DecisionIntelligence

EdgeMarket.AI 📣

@edgemarketai · Post #8009 · 27.02.2026 г., 12:43

Markets move on signals. Reality moves on decisions. A single announcement could reshape geopolitics, energy prices, defense markets, and global risk appetite. The question isn’t what you think it’s what happens next. EdgeMarket tracks real-world outcomes, not opinions. Will a Ukraine peace deal be announced by February 28? #Geopolitics#GlobalRisk#PredictionMarkets#DecisionIntelligence#Ukraine#USPolitics#EdgeMarket#FutureSignals#Macro