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

Резултати

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

Пребарај: #cómic

当前筛选 #cómic清除筛选
Arte Futura MX

@ArteFuturaMX · Post #1830 · 26.09.2021 г., 21:40

#Efemérides || 26 de septiembre de 1946 Con ayuda de Raymond Leblanc, un editor belga, empezó a publicarse la revista Tintín, revista independiente en que se publicaron Las aventuras de Tintín (iniciadas en 1930). La historieta fue creada por Hergé (psudónimo de Georges Remi, historietista belga) y se convirtió en una de las más influyentes series europeas de historietas del siglo XX. La serie conoció desde sus inicios un éxito sin precedentes. Se calcula que se han vendido desde sus inicios más de 200 millones de álbumes. #Imagen: Los personajes de Las aventuras de Tintín. #cómic#ArteFuturaMX https://artefutura.com.mx @artefuturamx

Arte Futura MX

@ArteFuturaMX · Post #1850 · 29.09.2021 г., 21:20

#Efemérides || 29 de septiembre de 1964 En la revista Primera Plana aparece por primera vez, en Argentina, la primera de las tiras regulares de Mafalda, obra de Joaquín Salvador Lavado Tejón "Quino". #Imagen: Primera tira de Mafalda en la revista Primera Plana el 29 de septiembre de 1964. #cómic#literatura#ArteFuturaMX https://artefutura.com.mx @artefuturamx

Arte Futura MX

@ArteFuturaMX · Post #2314 · 11.12.2021 г., 20:00

En la Edad de Oro de los cómics, cada número de Wonder Woman presentaba a una mujer histórica notable. En el número 33, con fecha de enero de 1949, Annie Jump Cannon fue el foco de "Wonder Women of History" en una tira escrita por Julius Schwartz, dibujada a lápiz por Paul Reinman y entintada por Bernard Sachs. #ciencia#cómic#ArteFuturaMX https://artefutura.com.mx @artefuturamx

📺 AnimeAction++

@animeactioz · Post #2571 · 03.05.2023 г., 19:53

DC Legion of Super Heroes Season 2 📅Año Septiembre 2007 - Mayo 2008 🎥Dirección Ben Jones, Tim Maltby, Lauren Montgomery, Scott Jeralds, James Tucker, Brandon Vietti 📄Guion Tim Cahill, Julie McNally Cahill. J.M. DeMatteis, Matt Wayne. Michael Jelenic, Rob Hoegee, Scott Sonneborn, Amy Wolfram, Stan Berkowitz, Steven Melching, John Esposito, Keith Damron, Eddie Guzelian, Rob Hummel, Marty Isenberg, Joseph Kuhr, David Slack, Greg Weisman 🎼Música Kristopher Carter, Michael McCuistion, Lolita Ritmanis 🎬Productora Warner Bros. Animation Género#SeriedeTV#Animación#Acción#Comedia#Superhéroes#Cómic#DCComics Reparto / Trailer / Premios ⏱Duración 22min. 🖥Resolución 720x400 🗣Idioma Inglés Subtítulos Latino Season 2 Episodio01 / 02 / 03 / 04 / 05 / 06 / 07 / 08 / 09 / 10 / 11 / 12 / 13 Season1

📺 AnimeAction++

@animeactioz · Post #2540 · 03.05.2023 г., 02:10

DC Legion of Super Heroes Season 1 📅Año Septiembre 2006 - Mayo 2007 🎥Dirección Ben Jones, Tim Maltby, Lauren Montgomery, Scott Jeralds, James Tucker, Brandon Vietti 📄Guion Tim Cahill, Julie McNally Cahill. J.M. DeMatteis, Matt Wayne. Michael Jelenic, Rob Hoegee, Scott Sonneborn, Amy Wolfram, Stan Berkowitz, Steven Melching, John Esposito, Keith Damron, Eddie Guzelian, Rob Hummel, Marty Isenberg, Joseph Kuhr, David Slack, Greg Weisman 🎼Música Kristopher Carter, Michael McCuistion, Lolita Ritmanis 🎬Productora Warner Bros. Animation Género#SeriedeTV#Animación#Acción#Comedia#Superhéroes#Cómic#DCComics Reparto / Intro / Sinopsis / Premios ⏱Duración 22min. 🖥Resolución 720x400 🗣Idioma Latino Season 1 Episodio01 / 02 / 03 / 04 / 05 / 06 / 07 / 08 / 09 / 10 / 11 / 12 / 13 Season2

📺 AnimeAction++

@animeactioz · Post #4110 · 23.08.2024 г., 11:46

DC Gen¹³ aka Gen 13 🗓Año 1999 ⏱Duración 73min. 🎥Dirección#KevinAltieri 📄Guion Kevin Altieri. 📚Cómic Jim Lee, Brandon Choi, J. Scott Campbell 🎼Música Amotz Plessner 🎬Productora Aegis Entertainment Género#Animación#Acción#Cienciaficción#Cómic#DCComics Reparto | Trailer | Sinopsis Ver Aquí AnexoDC Comics | Animación | SciFi | Comic

📺 AnimeAction++

@animeactioz · Post #3428 · 06.09.2023 г., 20:20

My Adventures with SupermanSeason 1 📅Año 2023 🎥Dirección#JakeWyatt (Creador) 🎬Productora Warner Bros. Animation, DC Entertainment. 🚚Distribuidora Adult Swim, HBO Max, Max Género#SeriedeTV#Animación#Aventuras#Acción#Fantástico#Superhéroes#DCComics#Cómic Reparto | Trailer | Sinopsis ⏱Duración 22min. 🖥Resolución 720x400 🗣Idioma Inglés Subtítulos Latino Season 1 Episodio01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 Suscripción a esta Serie 👉🏻Aquí Índice de Animaciones 👉🏻Aquí

📺 AnimeAction++

@animeactioz · Post #3418 · 02.09.2023 г., 02:59

My Adventures with SupermanSeason 1 📅Año 2023 🎥Dirección#JakeWyatt (Creador) 🎬Productora Warner Bros. Animation, DC Entertainment. 🚚Distribuidora Adult Swim, HBO Max, Max Género#SeriedeTV#Animación#Aventuras#Acción#Fantástico#Superhéroes#DCComics#Cómic Reparto | Trailer | Sinopsis ⏱Duración 22min. 🖥Resolución 720x400 🗣Idioma Inglés Subtítulos Latino Season 1 Episodio01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - ?? Suscripción a esta Serie 👉🏻Aquí Índice de Animaciones 👉🏻Aquí

📺 AnimeAction++

@animeactioz · Post #3415 · 22.08.2023 г., 20:40

My Adventures with SupermanSeason 1 📅Año 2023 🎥Dirección#JakeWyatt (Creador) 🎬Productora Warner Bros. Animation, DC Entertainment. 🚚Distribuidora Adult Swim, HBO Max, Max Género#SeriedeTV#Animación#Aventuras#Acción#Fantástico#Superhéroes#DCComics#Cómic Reparto | Trailer | Sinopsis ⏱Duración 22min. 🖥Resolución 720x400 🗣Idioma Inglés Subtítulos Latino Season 1 Episodio01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - ?? Suscripción a esta Serie 👉🏻Aquí Índice de Animaciones 👉🏻Aquí

📺 AnimeAction++

@animeactioz · Post #3393 · 14.08.2023 г., 06:31

My Adventures with SupermanSeason 1 📅Año 2023 🎥Dirección#JakeWyatt (Creador) 🎬Productora Warner Bros. Animation, DC Entertainment. 🚚Distribuidora Adult Swim, HBO Max, Max Género#SeriedeTV#Animación#Aventuras#Acción#Fantástico#Superhéroes#DCComics#Cómic Reparto | Trailer | Sinopsis ⏱Duración 22min. 🖥Resolución 720x400 🗣Idioma Inglés Subtítulos Latino Season 1 Episodio01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - ?? Suscripción a esta Serie 👉🏻Aquí Índice de Animaciones 👉🏻Aquí

📺 AnimeAction++

@animeactioz · Post #3383 · 07.08.2023 г., 20:40

My Adventures with SupermanSeason 1 📅Año 2023 🎥Dirección#JakeWyatt (Creador) 🎬Productora Warner Bros. Animation, DC Entertainment. 🚚Distribuidora Adult Swim, HBO Max, Max Género#SeriedeTV#Animación#Aventuras#Acción#Fantástico#Superhéroes#DCComics#Cómic Reparto | Trailer | Sinopsis ⏱Duración 22min. 🖥Resolución 720x400 🗣Idioma Inglés Subtítulos Latino Season 1 Episodio01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - ?? Suscripción a esta Serie 👉🏻Aquí Índice de Animaciones 👉🏻Aquí

📺 AnimeAction++

@animeactioz · Post #3356 · 30.07.2023 г., 04:56

My Adventures with SupermanSeason 1 📅Año 2023 🎥Dirección#JakeWyatt (Creador) 🎬Productora Warner Bros. Animation, DC Entertainment. 🚚Distribuidora Adult Swim, HBO Max, Max Género#SeriedeTV#Animación#Aventuras#Acción#Fantástico#Superhéroes#DCComics#Cómic Reparto | Trailer | Sinopsis ⏱Duración 22min. 🖥Resolución 720x400 🗣Idioma Inglés Subtítulos Latino Season 1 Episodio01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - ?? Suscripción a esta Serie 👉🏻Aquí Índice de Animaciones 👉🏻Aquí

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