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

Резултати

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

Пребарај: #rdp

当前筛选 #rdp清除筛选
GitHub 红队武器库🚨

@githubredteam · Post #82995 · 06.05.2026 г., 04:00

🚨 GitHub 监控消息提醒 🚨发现关键词:#横向#移动#RDP 📦项目名称:bandwagon-169-guide 👤项目作者:mxoc83 🛠开发语言: None ⭐Star数量: 1 | 🍴Fork数量: 0 📅更新时间: 2026-05-06 03:26:23 📝项目描述: 搬瓦工169.99套餐完整指南:配置是什么、怎么买、值不值?机房怎么选、优惠码用哪个(附各档位套餐横向对比) 🔗点击访问项目地址

GitHub 红队武器库🚨

@githubredteam · Post #82728 · 04.05.2026 г., 07:00

🚨 GitHub 监控消息提醒 🚨发现关键词:#横向#移动#RDP 📦项目名称:dmit-server-review 👤项目作者:tqmo99 🛠开发语言: None ⭐Star数量: 1 | 🍴Fork数量: 0 📅更新时间: 2026-05-04 06:22:46 📝项目描述: DMIT服务器好吗?从线路质量、硬件性能到价格套餐的完整评测:洛杉矶CN2 GIA、香港、日本机房横向对比,值不值得买一篇说清楚(附购买入门教程) 🔗点击访问项目地址

GitHub Trends

@githubtrending · Post #15209 · 09.10.2025 г., 14:30

#typescript#docker#docker_compose#linux#rdp#virtualization#windows WinBoat lets you run any Windows app on Linux with a smooth, native-like experience by running a full Windows system inside a Docker container using virtualization. It has an elegant interface and automates installation, so you just pick your settings and it handles the rest. You can run individual Windows apps seamlessly alongside Linux apps or access the full Windows desktop when needed. Your Linux files are easily shared with Windows, making file management simple. This helps you use Windows-only software on Linux without complicated setups, though it requires some system resources and setup steps like enabling virtualization and installing Docker. WinBoat is still in beta, so occasional bugs may occur. https://github.com/TibixDev/winboat

GitHub Trends

@githubtrending · Post #14894 · 02.07.2025 г., 11:30

#typescript#antd#antd_design#docker#go#golang#guacamole#rdp#react#ssh#vnc Next Terminal is a simple and secure system that lets you access and manage remote computers using protocols like RDP, SSH, VNC, Telnet, and HTTP. It is designed for businesses to record sessions, track audits, and help with compliance reporting, making IT management easier and safer. Using Next Terminal can improve security by monitoring remote access and help ensure your company meets regulatory requirements. It is user-friendly and supports multiple connection types, which saves time and effort in managing remote systems securely. Consulting your IT administrator before use is recommended for safe deployment. This tool benefits you by enhancing control and oversight of remote IT activities. https://github.com/dushixiang/next-terminal