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

Резултати

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

Пребарај: #hqmusic

当前筛选 #hqmusic清除筛选
PT资讯频道

@PrivateTrackerNews · Post #900 · 13.09.2019 г., 12:12

2019/09/13 中秋节快乐 Happy Mid-Autumn Festival #开放注册 #OpenSignupTracker #国外PT 电报 @PT资讯频道 Telegram @privatetrackernews 小型德国电影综合站 Tracker's Name: The Movie Cave Genre: Movies Sign-up Link: https://the-movie-cave.eu/login.php Closing date: Very soon! Additional information: The Movie Cave is a small German Private Torrent Tracker for Movies / General Releases. 电子书/有声书/在线学习 Twilights联盟 Tracker's Name: #P2PElite Genre: e-Learning Sign-up Link: https://p2pelite.com/signup.php Closing date: Soon! Additional information: P2PElite is a Private Torrent Tracker for Ebooks / Audiobooks. 拳击 Tracker's Name: Boxing Torrents (TC-Boxing) Genre: Sports Sign-up Link: https://tc-boxing.com/signup.php Closing date: N/A Additional information: Boxing Torrents 3.0 is a Private Torrent Tracker for Boxing. 越南音乐站 Tracker's Name: #HQMusic Genre: Music Sign-up Link: http://hqmusic.info/register.php Closing date: N/A Additional information: Registration for Vietnamese music gazelle tracker is open,Vietnamese Music Site that is useable even with a slight language barrier (Shout is in vietnamese but rules and stuff in English). Pretty good selection of FLAC music. Not too bad at all. #国内PT 菠萝 国内影视综合 Tracker's Name: #Brobits Genre: Movies Sign-up Link: https://brobits.cc/signup.php Closing date: September 15th Additional information: Brobits is a Chinese Private Torrent Tracker for Movies / TV Releases.

PT资讯频道

@PrivateTrackerNews · Post #676 · 05.07.2019 г., 16:18

2019/07/06 #开放注册 #OpenSignupTracker #国外PT 整理自电报 @PT资讯频道 Telegram @privatetrackernews 著名零日综合站 限1万名,有谷歌验证,注册使用邀请码 SUMMER2019 进站送15GB上传,可保种100个种子(种子体积10 MB以上才计算)慢慢攒魔力换上传或者辅种或者上盒子。 始于2006年,会员30万+,种子90万+,其中活跃种子30万+,全站黑种无免费,下载6GB后,总分享率要求为0.4,低于0.4将被警告,有6天时间提升回0.4。单种分享率大于0.4或者做种60小时(可间隔累积)以上免HR警告,连续HR警告可能被禁号。 关于零日(0day):0day就是比官方更早发布的影视资源版本。比如一部蓝光电影,官方正式发布日期是7月9号,但某网站7月8 日就已经发布了这电影的蓝光版本,那这个资源就是0day资源。为什么官方还没发布,而某网站却有这个资源,这里不作探讨。 Tracker's Name: #TorrentLeech Genre: General Sign-up Link: http://www.torrentleech.org/user/account/signup Closing date: HURRY UP! For the first 10k people only! Additional information: TorrentLeech (TL) is a Private Torrent Tracker for 0-Day / General Releases. Note: Use invite code SUMMER2019 in the sign up form 电影电视综合 ScenePalace是Twilights,TwilightZoom,p2pelite和TheHorrorCharnel的姐妹网站。 Tracker's Name: #ScenePalace Genre: General Sign-up Link: https://scenepalace.info/signup.php Closing date: Soon! Additional information: ScenePalace is a Private Torrent Tracker for Movies / TV / General Releases. As mentioned ScenePalace is a sister site of Twilights, TwilightZoom, p2pelite and TheHorrorCharnel. 越南无损音乐 Tracker's Name: #HQMusic Genre: Music Sign-up Link: http://hqmusic.info/register.php Closing date: Soon! Additional information: HQMusic is a Vietnamese Private Torrent Tracker for Lossless Music Releases. #开放申请注册 #OpenApplicationSignupTracker 德国零日综合 Tracker's Name: #TheShinning (Open for Application Signup) Genre: General Sign-up Link: https://theshinning.me/application Closing date: Soon! Additional information: The Shinning (TsH) is a German Private Torrent Tracker for 0-Day / General Releases.