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

Резултати

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

Пребарај: #aga

当前筛选 #aga清除筛选
UXLINK

@uxlink_community · Post #518 · 14.06.2025 г., 09:19

UXLINK Season 4 Airdrop Event & 2025 H1 Business Review Dear UXLINK Global Community, We are pleased to share our comprehensive 2025 first-half business review and announce the launch of the Season 4 Airdrop Event, designed to recognize and reward our valued contributors. 2025 H1 Key Achievements - User Growth: Reached 55 million registered users globally, solidifying our position as the #1 social platform in Web3. - Ecosystem Expansion: Partnered with over 500 organizations to drive innovation across the Web3 landscape. - Social Media Presence: Grew our TikTok user base to 1 million, enhancing engagement with broader audiences. - AI Integration: The AI Growth Agent (AGA) now supports 100,000+ social users and influencers, streamlining growth strategies for creators and startups. - Onchain Leadership: Maintained the #1 ranking in ETH ecosystem for $UXLINK and $UXUY holders, reflecting strong community trust. - Financial Performance: Achieved 12 consecutive months of profit growth and established strategic reserves of $BTC and $UXLINK to ensure long-term stability. - PayFi Ecosystem: Accelerated adoption of $UXLINK in daily transactions, with FujiCard undergoing public testing in over 10 countries. - Investment Milestone: Welcomed new strategic and long-term investors, reinforcing confidence in our vision for AI-powered Web3 infrastructure. Season 4 Airdrop Event: Reward Categories The Season 4 Airdrop is designed to recognize contributors across the following categories: 1. Influencer Starlink X influencers who drive adoption of AI Growth Agent(AGA) and create content promoting #UXLINK Season 4 & AGA. 2. PayFi Early Adopters Participants in the FujiCard public test (launching in Korea). 3. Social Club Card Phase 2 Users in Japan, Korea, Indonesia, and Vietnam are eligible for Phase 2 access to the Social Club Card. Partnership Task Achievers 4. Top yappers on the UXLINK Kaito Leaderboard and Kaito eco qualified users. How to Participate The Season 4 official website is now live at https://dapp.uxlink.io/season4. Visit to explore reward details, join ongoing initiatives, and contribute to building the UXLINK AI-powered Web3 Social Platform & Infrastructure. For questions or updates, follow us on X or join official Telegram groups and stay tuned for further announcements. #UXLINKSeason4#Airdrops#AGA Sincerely, The UXLINK Community

UXLINK

@uxlink_community · Post #514 · 10.06.2025 г., 07:13

Excited to partner with @PublicAI_ to innovate in AI and blockchain!🤝 PublicAI leverages 800k verified contributors for premium AI training data. Backed by @solana and @NEARProtocol Foundation & Stanford Blockchain Accelerator, secured $11M business revenue. #UXLINK AI Growth Agent will elevate AI training data quality together. 🚀 #AIAgent#PublicAI#AGA