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

Резултати

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

Пребарај: #herramienta

当前筛选 #herramienta清除筛选
BotsGram®

@botsgram_cu · Post #5063 · 28.12.2024 г., 01:38

¿Que puede hacer este bot? 🤖@siteshot_bot 📎El bot crea capturas de pantalla web Envía un enlace web y obtén una captura de pantalla de la página. • comprobar enlaces sospechosos (iploggers, sitios web de phishing, estafadores, etc.) • el bot se puede agregar a grupos #Herramienta ( Visto en: @BotsGram_Cu )

Hashtags

BotsGram®

@botsgram_cu · Post #5060 · 27.12.2024 г., 00:58

¿Qué puede hacer este bot? 🤖@ooSearchBot 📎Este bot es una extensión del motor de búsqueda nativo de Telegram. Aquí puedes buscar grupos, canales y bots activos de Telegram. Cada búsqueda te dará hasta 10 000 enlaces. Incluso puedes buscar enlaces privados y publicaciones de mensajes de Telegram. Envíame cualquier palabra clave que te interese y ¡pruébalo ahora! #Herramienta 📌Opinión personal: Una vez que lo uses, no volverás a usar el buscador nativo de Telegram. 10/10⭐️ ( Visto en: @BotsGram_Cu )

Hashtags

BotsGram®

@botsgram_cu · Post #5159 · 29.01.2025 г., 22:38

¿Que puede hacer este bot? 🤖@BHButtons_bot 📎Bot utilizado para crear publicaciones con todo tipo de botones y compartirlas en canales o grupos. También funciona en línea. Soporta texto y multimedia. #Herramienta#Edición ( Visto en: @BotsGram_Cu )

BotsGram®

@botsgram_cu · Post #5066 · 28.12.2024 г., 22:45

¿Que puede hacer este bot? 🤖@ImageResizerNewBot 📎Cambia el tamaño de las imágenes para alcanzar el tamaño de archivo o imagen deseado. #Herramienta#Edición ( Visto en: @BotsGram_Cu )

BotsGram®

@botsgram_cu · Post #5556 · 15.08.2025 г., 14:27

¿Qué puede hacer este bot? 🤖@BajarVideosBot 📎 Este es un potente bot para descargar videos de diferentes plataformas ▪️Sitios soportados: Youtube.com Facebook.com (Cuentas Publicas) TikTok.com Twitter.com Vimeo.comPinterest.com Otros Sitios #Herramienta#Descargar ( Visto en: @BotsGram_Cu )

BotsGram®

@botsgram_cu · Post #5161 · 29.01.2025 г., 22:38

¿Que puede hacer este bot? 🤖@ttloaderbot 📎El bot descarga vídeos de TikTok en la mejor calidad y sin marca de agua. #Descargar#Herramienta ( Visto en: @BotsGram_Cu )

BotsGram®

@botsgram_cu · Post #5145 · 23.01.2025 г., 23:57

¿Que puede hacer este bot? 🤖@VideoDownloadBot 📎El bot te permite descargar vídeos de TikTok, YouTube, VK, Instagram, Twitter y de otros 700 sitios. #Descargar#Herramienta ( Visto en: @BotsGram_Cu )

BotsGram®

@botsgram_cu · Post #5109 · 10.01.2025 г., 19:31

¿Que puede hacer este bot? 🤖@YtbDownBot 📎Soy YTBdownbot . Puedo descargar videos de YouTube y TikTok . El bot funciona directamente y en los chats . Agrega el bot a un grupo, luego envía el enlace del video y el bot enviará el video al chat. #Descargar#Herramienta ( Visto en: @BotsGram_Cu )

BotsGram®

@botsgram_cu · Post #5082 · 01.01.2025 г., 22:15

¿Que puede hacer este bot? 🤖@TGStoryXBot 📎Puede descargar fácilmente historias de Telegram y publicaciones archivadas de cualquier usuario en alta calidad y velocidad a través de su enlace. #Descargar#Herramienta ( Visto en: @BotsGram_Cu )

BotsGram®

@botsgram_cu · Post #5075 · 30.12.2024 г., 22:25

¿Que puede hacer este bot? 🤖@Kitefileupbot 📎Con este bot podrás descargar contenido de múltiples sitios en varios formatos y escucharlo en cualquier momento sitios web compatibles: (youtube, instagram, facebook, twitter, tiktok, likee, pinterest, snapchat). #Descargar#Herramienta ( Visto en: @BotsGram_Cu )

BotsGram®

@botsgram_cu · Post #5073 · 30.12.2024 г., 22:25

¿Que puede hacer este bot? 🤖@instaAnalysisBot 📎El bot te enviará historias de los usuarios que sigues en Instagram. Sin una VPN, de forma anónima, todas las publicaciones permanecerán en tu chat y podrás volver a ellas en cualquier momento. #Instagram#Herramienta ( Visto en: @BotsGram_Cu )

BotsGram®

@botsgram_cu · Post #5044 · 23.12.2024 г., 23:02

🤖@Pdot_ru_bot 📎chatbot GPT gratuito Características del robot: ✅ genera fotos y videos ✅ escribe códigos, textos, compone poesía ✅ trabaja con documentos ✅ reconoce lo que hay en la imagen Desarrollado por GPT-4o y DALLE #IA#Herramienta ( Visto en: @BotsGram_Cu )

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