@milideaspararegalar · Post #6334 · 16.06.2023 г., 16:56
Regalos para el #Hogar Para disfrutarlos en #Casa https://www.milideaspararegalar.es/regalos-para-el-hogar 💻www.milideaspararegalar.es
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
Пребарај: #casa
@milideaspararegalar · Post #6334 · 16.06.2023 г., 16:56
Regalos para el #Hogar Para disfrutarlos en #Casa https://www.milideaspararegalar.es/regalos-para-el-hogar 💻www.milideaspararegalar.es
@milideaspararegalar · Post #6046 · 01.06.2022 г., 16:55
Regalos para el #Hogar Para disfrutarlos en #Casa https://www.milideaspararegalar.es/regalos-para-el-hogar 💻www.milideaspararegalar.es
@milideaspararegalar · Post #5847 · 12.01.2022 г., 12:12
Regalos para el #Hogar Para disfrutarlos en #Casa https://www.milideaspararegalar.es/regalos-para-el-hogar 💻www.milideaspararegalar.es
@savinobalzano · Post #347 · 20.03.2023 г., 08:33
La direttiva sulle case green è una fregatura per l'Italia: speriamo che Bonelli questa volta lo capisca al volo, altrimenti farà la stessa figura che ha fatto con Soumahoro. Al pensionato che vive nella casetta del centro storico chi lo paga il cappotino termico? La mia al TG Plus di Cusano Italia TV #green#casa#ue#politica#italia#informazione#televisione
@cosmomyst · Post #320 · 23.09.2025 г., 22:21
🪐 When the massive star Cassiopeia A ended its life about 11,000 light-years away, it exploded in a spectacular supernova, flinging its outer layers into space and leaving behind a dense, spinning neutron star. The supernova's expanding cloud of debris is still visible today as a bright, colorful remnant, providing astronomers with a real-time laboratory to study the aftermath of one of the universe's most powerful explosions. ✨ #supernova⚡#casA⚡#neutronstar⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels
@cursosmegadrive6 · Post #852 · 02.10.2023 г., 21:50
🔰Papeleria En Casa Google Drive🔰 📌Categoria: #casa#escuela#tarea 𝑫𝑬𝑺𝑪𝑹𝑰𝑷𝑪𝑰𝑶𝑵 ➖Por si a alguien le interesa esto➖
@ideascasa · Post #17375 · 27.04.2024 г., 22:07
Decoración y diseño de interiores, ejemplos de utilización de espacios, estilos y usos de colores en áreas. #casa#diy#diyhome#home#ideasforhome#baño#cocina#habitacion#patio#pequeña#interiores
@yukiokhruner · Post #37 · 08.05.2022 г., 20:10
La canzone "C'è solo la strada" di Giorgio Gaber invecchia terribilmente bene e dopo il 2020 acquista quasi natura profetica. #vaporonda#vaporwave#vapourwave#vaporart#seapunk#webpunk#glitch#glitchart#glitchartistscollective#chillwave#aesthetic#vaporwaveaesthetic#vaporwaveaesthetics#malinconia#melancholy#tristezza#sadness#sadboy#lofi#solitudine#loneliness#isolamento#isolation#casa#home#giorgiogaber
@resinaymuchomas · Post #186 · 16.12.2021 г., 19:49
🤑Oportunidad única!! Curso Profesional de porcelana líquida 3D ahora en su país! . 😎 Comience 2022 con el pie derecho! . Aprenda en un fin de semana una NUEVA PROFESIÓN con esta innovadora técnica de aplicación de pisos y transforme cualquier ambiente simple en algo extremadamente lujoso. . ✅ Servicio con pronóstico de ALTA DEMANDA en 2022. ✅ Muy poca competencia. ¡Disfrútalo! ✅ Alto margen de BENEFICIO ✅ Excelente oportunidad para montar su negocio en 2022! ❌ Últimas Vacantes en el curso Da clic en en enlace del perfil o en el siguiente 👇🏻👇🏻 Aprovecha el descuento del 50% bit.ly/PISOSENPORCELANATO_DESCUENTO #mesa#porcelanato#encimeras#joyas#mesaderesina#empresario#arquitectura#negociopropio#trabajo#resina#cosasdelacasa#desing#joyasderesina#casa#resinaartist#carpenter#cocinasmoderna#dinero#casalujosa#decoracioninteriores#bhfyp