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 слични објави

Пребарај: #accounting

当前筛选 #accounting清除筛选

🇷🇺Rossiya xalq xo‘jaligi va davlat xizmati akademiyasi“Iqtisodiyot va moliya” kafedrasi dotsenti Alisen Alisenovni“Moliyaviy hisob” kursi bo‘yicha tinglovchilar uchun maxsus darsidan video lavha. #GraduateSchool#Seminar#Finance#Accounting Web-site |Telegram | Facebook |Instagram

Venture Village Wall 🦄

@venturevillagewall · Post #3524 · 20.12.2024 г., 09:30

Leapfin Secures $1M in Funding Leapfin has successfully raised $1 million in funding, set to close on December 17, 2024. The platform focuses on transforming transaction data into high-quality accounting data that is accurate, reliable, and timely. For more information, visit their website: Leapfin. #Leapfin#Funding#Accounting#Finance#Data

GitHub Trends

@githubtrending · Post #15577 · 20.03.2026 г., 12:30

#typescript#accounting#ai_analysis#currency_exchange#expenses#invoices#llm#llm_apps#self_hosted#taxes TaxHacker is a self-hosted AI app that automates accounting for freelancers and small businesses. Upload receipt photos or invoice PDFs, and it extracts key data like amounts, dates, merchants, taxes, and items, storing them in an easy database with auto-categorization, multi-currency conversion (even crypto), custom fields, and exports. You benefit by saving hours on manual entry, simplifying tax reports, ensuring privacy on your server, and focusing on your work instead of paperwork. https://github.com/vas3k/TaxHacker

Venture Village Wall 🦄

@venturevillagewall · Post #3966 · 24.01.2025 г., 01:00

Trump Family Spends Big on Crypto The Trump family crypto project, World Liberty Financial (WLFI), made significant moves in the crypto market: - Purchased 10.61 million TRX for 2.65 million USDT. - Acquired 3,079 ETH for 10 million USDC. - Converted and staked 4,700 ETH into stETH via Lido, totaling 14,701.58 ETH worth about $49 million. Check more details here: Onchain Lens. Additionally, the SEC has rescinded the controversial accounting guidance SAB 121 that affected Bitcoin custody by banks. More insights at Leviathan News and The Block. #Crypto#Bitcoin#SEC#TRX#ETH#USDC#Ethereum#WorldLibertyFinancial#Lido#stETH#Trump#SAB121#Accounting#Finance#USD#WhaleAlert#USDT

Venture Village Wall 🦄

@venturevillagewall · Post #4025 · 30.01.2025 г., 01:00

Bitcoin Dominates Market with Huge Gains Tesla's bitcoin holdings surge to $1.076 billion, boosting GAAP revenue by $600M. 🎉 The Sei Foundation launches a $65M fund for decentralized science startups, while GMCI unveils an index for US crypto protocols. Notably, Texas announces plans for a Bitcoin Reserve. Read more about Tesla's valuation increase here. Explore the Sei Fund details here and GMCI's index here. #Bitcoin#Tesla#DeSci#VC#Crypto#Funding#Texas#Cryptocurrency#Investment#MarketTrends#GMCI#Sei#Startups#Blockchain#Protocol#Accounting#Finance#Legislation#Innovation#CryptoProtocol

GitHub Trends

@githubtrending · Post #14994 · 24.07.2025 г., 12:00

#typescript#accounting#book_keeping#desktop#double_entry_accounting#electron#frappe#inventory_management#invoicing#javascript#offline#open_source#point_of_sale#vuejs Frappe Books is a free, open-source accounting software designed to make managing your business finances simple and efficient. It works on Windows, Mac, and Linux, and you can use it offline since it stores data locally on your computer. It offers easy invoicing with customizable templates, tracks payments, and provides important financial reports like profit and loss, balance sheets, and trial balances. The software has a clean, user-friendly interface and features like a dashboard for quick financial insights and a point-of-sale system for retail. This helps you save time, stay organized, and make smarter business decisions without complex tools or extra costs[1][3][4]. https://github.com/frappe/books