داشتم پروژه django شرکت رو میخوندم یک مشکل داریم سر بعضی endpointها و برخی تسکها. اولین کاری کردم این بوده که یک سری دیتا تست با faker بهش دادم مثه loadtest ولی بدون ابزار و بعد هم profiling گرفتم و ذخیره کردم. چیز جالبی که دیدم؛ پروژه موقع کار کردن با redis به مشکل میخورد. ولی redis منابعش بیشتر از حد مورد نیازش بود.
حجم دیتاهای تست رو کم کردم و مشکل حل شد؛ توی چندتا تست مختلف که زدم دیدم مسئله و مشگل از سمت پیکج redis هست توی پایتون و راهکار ساده رو هم خود redis داده (هرچند من برعکس بهش رسیدم)
$ pip install "redis[hiredis]"
بجای اینکه برای parse کردن دیتا از python استفاده کنه وقتی hiredis رو نصب کنید از C استفاده میکنه (بنچمارکاش هم توی گیتهاب hiredis هست ببینید)
مشکل خیلی ساده حل شد؛ ولی برای این حل ساده خیلی زمان و درک profiling لازم بود.
داشتم پروژه django شرکت رو میخوندم یک مشکل داریم سر بعضی endpointها و برخی تسکها. اولین کاری کردم این بوده که یک سری دیتا تست با faker بهش دادم مثه loadtest ولی بدون ابزار و بعد هم profiling گرفتم و ذخیره کردم. چیز جالبی که دیدم؛ پروژه موقع کار کردن با redis به مشکل میخورد. ولی redis منابعش بیشتر از حد مورد نیازش بود.
حجم دیتاهای تست رو کم کردم و مشکل حل شد؛ توی چندتا تست مختلف که زدم دیدم مسئله و مشگل از سمت پیکج redis هست توی پایتون و راهکار ساده رو هم خود redis داده (هرچند من برعکس بهش رسیدم)
$ pip install "redis[hiredis]"
بجای اینکه برای parse کردن دیتا از python استفاده کنه وقتی hiredis رو نصب کنید از C استفاده میکنه (بنچمارکاش هم توی گیتهاب hiredis هست ببینید)
مشکل خیلی ساده حل شد؛ ولی برای این حل ساده خیلی زمان و درک profiling لازم بود.
اهمیت profiling
BY Python Hints
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.
What Is Bitcoin?
Bitcoin is a decentralized digital currency that you can buy, sell and exchange directly, without an intermediary like a bank. Bitcoin’s creator, Satoshi Nakamoto, originally described the need for “an electronic payment system based on cryptographic proof instead of trust.” Each and every Bitcoin transaction that’s ever been made exists on a public ledger accessible to everyone, making transactions hard to reverse and difficult to fake. That’s by design: Core to their decentralized nature, Bitcoins aren’t backed by the government or any issuing institution, and there’s nothing to guarantee their value besides the proof baked in the heart of the system. “The reason why it’s worth money is simply because we, as people, decided it has value—same as gold,” says Anton Mozgovoy, co-founder & CEO of digital financial service company Holyheld.