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

Резултати

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

Пребарај: #oneplus13

当前筛选 #oneplus13清除筛选
Oneplus 13 Updates

@OnePlus13Series · Post #40 · 04.11.2024 г., 16:01

The free split screen of OnePlus 13 combined with the Snapdragon 8 Elite is simply too powerful. It can run three games smoothly at the same time, triple the fun #OnePlus13

Hashtags

Oneplus 13 Updates

@OnePlus13Series · Post #144 · 14.02.2025 г., 08:54

#ColorOS15#OnePlus13 fkcoloros Isp Module v1.1.0 Features: • Improved custom ClipboardScene Fluid Cloud, adding default support for v2ex, Kujiale, HomeAssistant, Pixiv, eHentai, QooApp, Apple Music, TapTap, YouTube, Zhihu, GitHub, Steam, SMZDM, Dianping, Ctrip. • Enhanced Fluid Cloud replacement rules and added default support for bili2PiliPalaX. • Improved custom sidebar tools. • Removed Ul support for foldable phones and tablets. • Forced apps to portrait mode only. • Optimized some feature descriptions. • Removed BL skip detection. • Recent tasks menu now shows a toast notification if the corresponding activity cannot be found. • LibChecker-dependent feature: Recent tasks menu will only show if LibChecker is installed. • Removed unnecessary logs. • Updated Compose dependencies.  By August Join @OnePlus13Series Chat @OnePlus13SeriesChatRoom

Oneplus 13 Updates

@OnePlus13Series · Post #341 · 13.11.2025 г., 15:50

OnePlus 13 Specifications Codename: dodge cc: TechleaksZone • 6.82" (3168×1440 px) 2K+ BOE X2 LTPO AMOLED display • 1-120Hz variable refresh rate • 4500nits peak brightness • 2160Hz PWM Dimming • Dolby Vision; 1.07 billion colors • Crystal Shield glass protection • Snapdragon 8 Elite SoC • LPDDR5X RAM; UFS 4.0 storage • 9925mm² VC chamber • 50MP main (LYT-T 808, OIS) • 50MP Ultrawide (JN5); 2.5cm macro • 50MP 3X Telephoto (LYT-600; OIS) • 120X Digital Zoom; Hassleblad camera • 32MP Front camera • AAC CSA+ 0916 X-axis linear motor (volume 602mm³) • Goodix Ultrasonic fingerprint • IR Blaster; Alert Slider • Dust & water resistant (IP68 + IP69) • Stereo speakers, OReality & OHaptics • 6000mAh battery; USB-C 3.2 Gen 1 • 100W wired (Max 6.0A at 10V) + 50W wireless charging (Upto 18W PD - IN variant) •4 AndroidOS upgrades + 6yrs Security Patches. (Android 15 OOB) •Lifetime Display Warranty for greenline concerns (For India) @OnePlus13Series | @OnePlus13SeriesChatRoom #oneplus13#specs#oxygenos

Oneplus 13 Updates

@OnePlus13Series · Post #289 · 13.07.2025 г., 00:38

📱SunOS-Project - Official | Android 15 | OnePlus 13 (dodge) 🗒Details: • Version: #varuna (A15) • Codename: #dodge • Released: 09/07/25 🆘Support: Telegram 📸Screenshots: Click Here 💵Donate: Paypal | UPI: dyavanapellichandu@ybl (If you like our work and want to support development, it helps pay server bills and infrastructure) 🔖Tags: #ROM#SunOS#Android15#Official#OnePlus13#dodge ✨SourceChangelogs: • Initial A15 Release based on CPH2653_15.0.0.831(EX01) firmware blobs ✅Working: • Camera & Flashlight • WiFi, Bluetooth • Telephony (Calls & Data) • IMS (VoLTE, VoWiFi, RCS) • Audio (Playback & Record) • Video Playback • GPS, Sensors • WiFi Display ❌Broken: • eSIM (WIP) 📦Compatibility: • All variants supported: EU / IN / CN / NA 📔Note: Make sure both slots have the same firmware to avoid critical issues! 🧩FlashInstructions: ⚠️ Ensure both slots have the same firmware before flashing! • Download images from here. fastboot flash init_boot init_boot.img fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash vendor_boot vendor_boot.img fastboot -w fastboot reboot recovery ➡️Inrecovery: • Factory reset (wipe/format data) • ADB sideload the SunOS zip • Reboot and enjoy 🌞 📥Download: 🔗Sourceforge | Mirror