@ChrisBrownfans2020 · Post #3562 · 15.06.2025 г., 18:17
📈#ChrisBrown’s “Holy Blindfold” becomes one of his biggest streaming debuts. It received 1,274,313 streams in its accumulative day of tracking on Spotify.
Hashtags
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
Пребарај: #chrisbrown
@ChrisBrownfans2020 · Post #3562 · 15.06.2025 г., 18:17
📈#ChrisBrown’s “Holy Blindfold” becomes one of his biggest streaming debuts. It received 1,274,313 streams in its accumulative day of tracking on Spotify.
Hashtags
@ChrisBrownfans2020 · Post #3409 · 26.10.2024 г., 22:34
📈#ChrisBrown’s “Residuals” has now surpassed 40 Million Spotify streams! @chrisbrown where’s the music video? 🤔
Hashtags
@ChrisBrownfans2020 · Post #3391 · 07.10.2024 г., 15:12
📈#ChrisBrown’s “Residuals” has moved up to #60 on Billboard Radio Songs charts.
Hashtags
@ChrisBrownfans2020 · Post #3326 · 22.07.2024 г., 23:29
📈#ChrisBrown’s ‘11:11’ has just reached 700 Million Spotify streams 🎉
Hashtags
@ChrisBrownfans2020 · Post #3241 · 09.06.2024 г., 03:44
5 years ago today, Chris Brown released “No Guidance” featuring Drake #ChrisBrown
Hashtags
@ChrisBrownfans2020 · Post #3206 · 14.05.2024 г., 14:33
📈#ChrisBrown’s ‘11:11’ tour ticks off next month. What song would you like to be the opener? ⬇️
Hashtags
@ChrisBrownfans2020 · Post #3203 · 13.05.2024 г., 03:46
📈#ChrisBrown’s ‘Delusional’ and ‘Residuals’ have both now surpassed 5 Million streams on Spotify.
Hashtags
@ChrisBrownfans2020 · Post #3131 · 05.03.2024 г., 05:34
📈🚨#ChrisBrown’s ‘11:11 Tour’ is upon us!! Billboards are being placed across multiple Arenas in USA displaying 11:11
Hashtags
@ChrisBrownfans2020 · Post #3099 · 27.01.2024 г., 23:14
#ChrisBrown’s ‘Angel Numbers / Ten Toes’ has surpassed 70 Million streams on Spotify.
Hashtags
@ChrisBrownfans2020 · Post #3086 · 09.01.2024 г., 23:53
#ChrisBrown’s ‘Angel Numbers / Ten Toes’ has reached 50 Million Spotify streams 🎉
Hashtags
@ChrisBrownfans2020 · Post #3059 · 13.12.2023 г., 02:15
🚨Kanye West and Ty Dolla Sign will release their album ‘Vultures’ this Friday. #ChrisBrown on Track 5.
Hashtags
@ChrisBrownfans2020 · Post #3543 · 27.03.2025 г., 14:05
🚨 Chris Brown just announced his Stadium World Tour, "Breezy Bowl XX," in celebration of his 20th career anniversary. The tour will take place in Europe and North America, featuring special guests Summer Walker and Bryson Tiller. #Chrisbrown#breezybowl
Hashtags