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

Резултати

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

Пребарај: #account

当前筛选 #account清除筛选

😄Account ➖➖➖➖➖➖ 🔘An account is a record. We often use it to talk about recording money. If a bank looks after your money, you have an account with them. The arrangement that a business has with a client can also be called an account. 🔜You should put that money in a saving account. 🔜I'm responsible for the company's biggest account. 🔘An account can also be a description of something that happened, or a story. 🔜The police wanted to hear his account of what happened. 🔘We also use account in some common expressions. If you take something into account, then you consider it and if you account for something you explain why it happened. 🔜You'll need to take many factors into account to make this decision. 🔜We need you to account for your behaviour. #Account👨‍🏫@America ➖➖➖➖➖➖➖➖➖➖➖➖ 🆕 Crypto News @Money 😁 Crypto Game @Egame 🇺🇸 US News @America 🇯🇵 Japan News @Japan 🇦🇪 UAE News @Dubai ▶️ Popular Movies @Videos 😜 Best Funny Video @Funnys

Hashtags

NEWS 鏈新聞-ABMedia

@abmedia_news · Post #24214 · 29.04.2026 г., 06:30

【🚀 傳統金融|Robinhood 配合「川普帳戶」將投入一億美元,HOOD 盤後下跌近 10%】 #HOOD#Trump#Account Robinhood 於第一季財報指出營收年增 15%,但營業支出成長幅度超越營收。 加密營收年減 47% 至 1.34 億美元,並為川普帳戶投入 1 億美元。高額支出增加資本挑戰 — 股價盤後大跌。 📍閱讀全文: https://abmedia.io/robinhood-2026-q1-financial-report 📍 訂閱鏈新聞頻道:https://linktr.ee/abmedia.io

BotsGram®

@botsgram_cu · Post #3411 · 20.01.2021 г., 14:26

@creationdatebot Qué puede hacer este bot? Este bot interpola las fechas de creación de cuentas basadas en ID de telegrama dado Idioma: Inglés, Español, Ruso, uzbeco, Polaco, Árabe (visto en @BotsGram_cu) #account, #creationdate, #ids

BotsGram®

@botsgram_cu · Post #3296 · 16.12.2020 г., 16:40

@getaltsbot Qué puede hacer este bot? Este bot le permite alquilar números reales de teléfono por un período de 20 minutos para registrar cuentas de Telegram, Google, WhatsApp. Idioma: Inglés (visto en @BotsGram_cu) #alt, #account, #phonenumber, #paid, #buy, #identity, #telegram

BotsGram®

@botsgram_cu · Post #3477 · 06.02.2021 г., 14:12

@pwned_robot Qué puede hacer este bot? Telegram Bot que puede comprobar si tiene una cuenta o contraseña que se ha visto comprometida en una violación de datos. Uso limitado (se pagan pocas opciones). Idioma: Inglés (visto en @BotsGram_cu) #breach, #security, #hack, #password, #account, #compromised, #pwned, #checkpsw, #paste, #paid