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

Резултати

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

Пребарај: #tdesktop

当前筛选 #tdesktop清除筛选
Telegram github commits and releases

@tgappsupdates · Post #19721 · 18.04.2026 г., 00:00

telegramdesktop/tdesktop/dev • ed1e3ca • 1 files, +1/-1 Bump actions/deploy-pages from 4 to 5 Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4 to 5. - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](https://github.com/actions/deploy-pages/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/deploy-pages dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19717 · 17.04.2026 г., 08:00

telegramdesktop/tdesktop/dev • ef848e0 • 1 files, +8/-8 Port Linux notifications to std::get_if There's no sense to use abstrations calling std::holds_alternative telegramdesktop/tdesktop/dev • 92488b2 • 2 files, +19/-26 Move GNotification action creation to the rest of notification code telegramdesktop/tdesktop/dev • bc2eb3d • 1 files, +4/-20 Remove explicit disconnections where object lifetime is the same telegramdesktop/tdesktop/dev • b5f3ea6 • 2 files, +26/-1 Try to use KSandbox::startHostProcess telegramdesktop/tdesktop/dev • 3fbe302 • 2 files, +167/-0 feat(accessibility): add screen reader support for country select box #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19716 · 17.04.2026 г., 05:45

telegramdesktop/tdesktop/dev • 66b38cc • 1 files, +9/-2 Pause animations only if video message isn't paused. telegramdesktop/tdesktop/dev • 5eed813 • 1 files, +2/-3 Fix layout for RTL messages. telegramdesktop/tdesktop/dev • 4319245 • 3 files, +204/-31 Allow seeking in video messages. #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19709 · 16.04.2026 г., 14:46

telegramdesktop/tdesktop/dev • 0e7a483 • 1 files, +1/-1 Fix muted icon outline clipping. telegramdesktop/tdesktop/dev • b87df70 • 1 files, +6/-7 Fix microphone testing in Settings. telegramdesktop/tdesktop/dev • d39af8e • 1 files, +2/-2 [ai] Fix custom command for icon creation. telegramdesktop/tdesktop/dev • ce10b71 • 1 files, +1/-1 Fix geometry counting around collapsed blockquote. telegramdesktop/tdesktop/dev • e3a34ea • 5 files, +90/-21 Cache date string in dialog rows. telegramdesktop/tdesktop/dev • f31421a • 1 files, +2/-2 Fix unread media indicator display. telegramdesktop/tdesktop/dev • 1b96772 • 1 files, +3/-3 Allow continue macOS build after partial. telegramdesktop/tdesktop/dev • 2cd90eb • 14 files, +958/-133 Add proxy auto-rotation option. #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19703 · 15.04.2026 г., 07:22

Assets for releasev6.7.6of telegramdesktop/tdesktop: • Source code (tar.gz, full) • Windows on ARM: Portable • Windows 64 bit: Portable • Windows 32 bit: Portable • Windows on ARM: Installer • Windows 64 bit: Installer • macOS 10.13+: Installer • Windows 32 bit: Installer • Linux 64 bit: Binary #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19702 · 15.04.2026 г., 06:45

New telegramdesktop/tdesktop release: v6.7.6 (stable) - Gradient-reveal animation for text appearing in messages. - Support draw-to-reply from shared media. - Frame-by-frame stepping and hold-to-speedup hotkeys in media view. - Fix loading stickers and emoji search results. - Custom emoji picker for premium quick reaction. - Search in section of pinned messages. - Recent search entries in settings search. - Hide phone number in main settings section. - Suggest sending large texts as files. - Allow creating polls with single answer option. - Bring menus and fullscreen media viewer to active space on macOS. - Fix several poll display and voting menu issues. - Fix possible crashes in chats list, url auth and others. #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19701 · 15.04.2026 г., 05:16

telegramdesktop/tdesktop/dev • f9d8628 • 1 files, +1/-1 Fix build with GCC. telegramdesktop/tdesktop/dev • 33dda9d • 1 files, +27/-1 Return possibility for maps handler customization on Windows. telegramdesktop/tdesktop/dev • 59e9a91 • 2 files, +7/-1 First text appearing animation duration floor. telegramdesktop/tdesktop/dev • 668a91b • 6 files, +31/-15 Version 6.7.6. - Gradient-reveal animation for text appearing in messages. - Support draw-to-reply from shared media. - Frame-by-frame stepping and hold-to-speedup hotkeys in media view. - Fix loading stickers and emoji search results. - Custom emoji picker for premium quick reaction. - Search in section of pinned messages. - Recent search entries in settings search. - Hide phone number in main settings section. - Suggest sending large texts as files. - Allow creating polls with single answer option. - Bring menus and fullscreen media viewer to active space on macOS. - Fix several poll display and voting menu issues. - Fix possible crashes in chats list, url auth and others. #tdesktop

Hashtags

123•••5•••10•••15•••20•••25•••30•••35•••40•••45•••50•••55•••60•••656667
ПретходнаСтраница 1 од 67Следна