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 слични објави

Пребарај: #communitydriven

当前筛选 #communitydriven清除筛选
UXLINK

@uxlink_community · Post #331 · 12.03.2025 г., 07:40

🚀 Big News! We’re joining forces with major DEXs to take our Web3 journey to the next level! 🌐But more importantly, YOUR voice matters. 🗳️ Cast your vote on our latest community proposal and shape the future of decentralized social platforms! Vote now 👉 [https://snapshot.box/#/s:uxlinkcommunity.eth/proposal/0xee641f312d19250357b0682604e167f4cfc259768c1c2d2aaa8e107a7feb8ffc] #UXLINK#DeFi#CommunityDriven

UXLINK

@uxlink_community · Post #543 · 11.07.2025 г., 01:30

Huge thanks to the #UXLINK global community for your support! 🎉 We’re thrilled to share that the proposal to cross-chain a portion of $UXLINK supply to @BNBCHAIN(for @PancakeSwap) passed with an 86.08% approval vote! Implementation will kick off soon, and plans for the UXLINK/USDT trading pair + official LP are already in the works. Stay tuned for updates💪 #BNBChain#PancakeSwap#CommunityDriven

ChatGPT AI Technology News

@chatgpt_officialnews · Post #20 · 28.01.2025 г., 17:01

🌟 Exciting News for Our Users! 🌟 We’ve upgraded our system with a token mechanism for seamless usage! 🎉 Here's how it works: 💡 Tokens are deducted based on the number of characters in your question and the bot’s response. 📥 Daily Bonus: Every day, you’ll receive a free token refill to keep chatting without interruptions! 💳 Recharge Options: You can now top up your balance using Telegram Stars and cryptocurrency payments (BTC, ETH, USDT, and more)! 🚀 Enjoy more flexibility and freedom with this new system. Thank you for being part of our community – stay tuned for more updates! 💬 ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Join Us! ⚡️ 🤖 BOT: @Chatgpt_OfficialBOT 📱#ChatGPT#AI#OpenAI#TokenSystem#CryptoPayments#BotSupport#CommunityDriven ➖➖➖➖🔺

UXLINK

@uxlink_community · Post #470 · 10.05.2025 г., 05:27

最近の日本Web3界隈で目立つのが、UXLINKの存在感。🇯🇵🔍 CNPとの提携を皮切りに、日本ローカルの強力なIPとの協業が加速⚡ オンチェーン/オフチェーン両方でのコミュニティ展開に加え、 Web2企業とのクロスパートナー戦略も水面下で進行中🤝 “ユーザー起点のWeb3ソーシャル”という文脈で、 UXLINKは今、日本で一番面白い動きをしているかもしれない。🚀 #UXLINK#Web3JP#CNP#ソーシャルレイヤー#CommunityDriven One of the most quietly significant players gaining traction in Japan’s Web3 scene 🇯🇵👀#UXLINK Following its recent collaboration with CNP—a top domestic IP—UXLINK is making inroads across both native Web3 communities and mainstream Web2 circles 🤝 IRL activations, on-chain social dynamics, and a clear long-term strategy signal a serious Japan play 🎯 If you're tracking the rise of social infrastructure in Asia’s Web3 movement, this is one to watch. 📡 #UXLINK#Web3Japan#CommunityLayer#CNP#Web3Social

EdgeMarket.AI 📣

@edgemarketai · Post #8086 · 31.03.2026 г., 11:54

The next layer of EdgeMarket is live. We’re introducing community validation for real world events feeding verified truth directly into AI systems. Every validation strengthens the network. Every correct signal earns rewards. ⚡ Validate events 🧠. Train AI with real data 💰 Earn $BET This is how decentralised intelligence is built. Signal Truth. Earn $BET Click Here ⬇️ To Start https://edgemarket.ai/bnb/validate-results #EdgeMarket#AI#Web3#Crypto#BET #Airdrop#EarnCrypto#SignalTruth#Validation #Decentralization#AITraining#Blockchain #CommunityDriven#OnChain#DePIN