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

Резултати

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

Пребарај: #mdx

当前筛选 #mdx清除筛选
GitHub Trends

@githubtrending · Post #15483 · 10.02.2026 г., 14:00

#mdx This free interactive course teaches Product Managers to use Claude Code for daily tasks like processing notes, writing PRDs, analyzing data, and strategy planning through hands-on modules (4-6 hours). Clone the repo, run `claude`, and follow guided lessons with agents and file tools—no setup needed yet. You'll work faster, get instant multi-perspective feedback, and boost productivity without quality loss. https://github.com/carlvellotti/claude-code-pm-course

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8725 · 04.03.2023 г., 10:40

#MDX👈 https://www.binance.com/en/trade/MDX_BTC Buying Zone 390-410 Buy in parts... Strictly follow as directed for max profits Sell. 🤑450-480 🤑480-520 🤑 520-550 🤑 550-590 🤑 630-670 🚀 710-750 & above Bullish above 380

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8703 · 10.02.2023 г., 14:30

#MDX👈 https://www.binance.com/en/trade/MDX_BTC Buying Zone 410-420 Buy in parts... Strictly follow as directed for max profits Sell. 🤑460-480 🤑480-520 🤑 520-550 🤑 550-590 🤑 630-670 🚀 710-750 & above Bullish above 400

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8605 · 24.12.2022 г., 19:17

#MDX👈 https://www.binance.com/en/trade/MDX_BTC Buying Zone 430-440 Buy in parts... Strictly follow as directed for max profits Sell 🤑480-500 🤑 500-530 🤑 530-570 🤑 570-610 🚀 610-650 & above Bullish above 420

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8587 · 16.12.2022 г., 08:42

#MDX👈 https://www.binance.com/en/trade/MDX_BTC Buying Zone 450-465 Buy in parts... Strictly follow as directed for max profits Sell 🤑 500-530 🤑 530-570 🤑 570-610 🚀 610-650 & above Bullish above 440

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8507 · 21.11.2022 г., 13:32

#MDX👈 https://www.binance.com/en/trade/MDX_BTC Buying Zone 450-480 Buy in parts... Strictly follow as directed for max profits Sell 🤑 520-530 🤑 530-570 🤑 570-610 🚀 610-650 & above Bullish above 440 Signal Dare 21/11/22

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8426 · 06.11.2022 г., 16:52

#MDX👈 https://www.binance.com/en/trade/MDX_BTC Buying Zone 520-544 Buy in parts... Strictly follow as directed for max profits Sell 🤑 571-600 🤑 600-650 🤑 650-700 🚀 700-750 & above Bullish above 500

Hashtags

Binance Big Pump Signals Future trade

@binancebigpumpsignalsfuture · Post #2032 · 10.02.2022 г., 17:45

#MDX result 1 and 2 target achieved in just 1 house 21 minutes ✅ One more huge quick profit 11%🤑💰🤑 👉 Still thinking? The more you wait more you lose profit ☎️ Contact @MichaelStrategiesVip for membership and grab next breakout signal

Hashtags

Crypto

@signal_bitcoins · Post #1958 · 22.12.2023 г., 11:44

#MDX bounced back from the Trendline on 6H Time frame,we expect a good bullish momentum from the Green zone,send it to the moon 🚀 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

AppPie

@AppPie · Post #2364 · 19.03.2025 г., 04:04

#Developers Nextra: 基于 Next.js 的强大网站生成框架 🔗GitHub Nextra 是一个简单、强大且灵活的网站生成框架,融合了 Next.js 的所有优势,专为创建美观的文档和博客网站而设计。 主要功能 • MDX 支持:使用 React 组件增强 Markdown 内容 • 自动优化:自动将 Markdown 链接和图片转换为 Next.js 组件 • 语法高亮:由 Shiki 提供的高性能语法高亮解决方案 • 国际化:通过文件夹结构轻松实现多语言支持 • 全文搜索:构建时自动索引内容,通过 Pagefind 提供高速搜索 • 暗黑模式:内置深色主题支持 • 插件主题:支持文档和博客两种主题,也可自定义 安装使用 通过 npm/yarn/pnpm 安装。根据 文档 配置项目结构。 开源许可证 MIT license。 #GitHub#OpenSource#Nextjs#MDX#Documentation#Framework 📮 频道 @AppPie

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