Telegram Group & Telegram Channel
یک ابزار داریم (روی Rust) که توی چندتا بخش نیاز به پردازش یک سری header های درخواستی که میاد داره.
یا مثلا بعضی جاها کاربر می‌تونه permission هارو باهاشون کار کنه و ...

همیشه خیلی سریع پردازش انجام می‌شد و تمام؛ دیروز یکی از مشتری‌ها اعلام کرد که ابزار خیلی کند شده (برای یک سرور خاص البته) بعد از کلی بررسی متوجه شدم :

تعداد فایل‌هایی که روی این سرور دارند خیلی خیلی زیاد هست ولی چون حجم خیلی خیلی پایینی داره اکثرا و توی یک هارد کوچیک جا شده؛ مشتری توقع داره سرعت بالاتر باشه.
نسبت به سروری که مثلا ۵۰۰ تا فایل ۱۰ گیگ داره.

حدودا ۳۲-۳۴٪ سرعت با تغییر operator های معمولی چک کردن هدر و پردازش permission, .... به Bitwise operator بدست اومد.
گفتم یک مثال هم اینجا بزنم؛ فقط توی این مثال به چندتا چیز توجه کنید:

۱- زوج بودن عدد محاسبات سنگینی نداره هرچند؛ محاسبه باقی‌مانده از AND گرفتن سنگین تر هست.

۲- پایتون زبان سطح بالاس؛ محاسبه باقی مانده و AND سربارهای پایتونی داره که باعث میشه تفاوت کمتر بشه و CPython هم بسیار اپتیمایز شده هست.

۳- مثال خیلی ساده هست.

با این حال مفهوم رو آموزش میده و تفاوت اندک هم میشه دید.
👍184



tg-me.com/pyHints/846
Create:
Last Update:

یک ابزار داریم (روی Rust) که توی چندتا بخش نیاز به پردازش یک سری header های درخواستی که میاد داره.
یا مثلا بعضی جاها کاربر می‌تونه permission هارو باهاشون کار کنه و ...

همیشه خیلی سریع پردازش انجام می‌شد و تمام؛ دیروز یکی از مشتری‌ها اعلام کرد که ابزار خیلی کند شده (برای یک سرور خاص البته) بعد از کلی بررسی متوجه شدم :

تعداد فایل‌هایی که روی این سرور دارند خیلی خیلی زیاد هست ولی چون حجم خیلی خیلی پایینی داره اکثرا و توی یک هارد کوچیک جا شده؛ مشتری توقع داره سرعت بالاتر باشه.
نسبت به سروری که مثلا ۵۰۰ تا فایل ۱۰ گیگ داره.

حدودا ۳۲-۳۴٪ سرعت با تغییر operator های معمولی چک کردن هدر و پردازش permission, .... به Bitwise operator بدست اومد.
گفتم یک مثال هم اینجا بزنم؛ فقط توی این مثال به چندتا چیز توجه کنید:

۱- زوج بودن عدد محاسبات سنگینی نداره هرچند؛ محاسبه باقی‌مانده از AND گرفتن سنگین تر هست.

۲- پایتون زبان سطح بالاس؛ محاسبه باقی مانده و AND سربارهای پایتونی داره که باعث میشه تفاوت کمتر بشه و CPython هم بسیار اپتیمایز شده هست.

۳- مثال خیلی ساده هست.

با این حال مفهوم رو آموزش میده و تفاوت اندک هم میشه دید.

BY Python Hints




Share with your friend now:
tg-me.com/pyHints/846

View MORE
Open in Telegram


Python Hints Telegram | DID YOU KNOW?

Date: |

How to Invest in Bitcoin?

Like a stock, you can buy and hold Bitcoin as an investment. You can even now do so in special retirement accounts called Bitcoin IRAs. No matter where you choose to hold your Bitcoin, people’s philosophies on how to invest it vary: Some buy and hold long term, some buy and aim to sell after a price rally, and others bet on its price decreasing. Bitcoin’s price over time has experienced big price swings, going as low as $5,165 and as high as $28,990 in 2020 alone. “I think in some places, people might be using Bitcoin to pay for things, but the truth is that it’s an asset that looks like it’s going to be increasing in value relatively quickly for some time,” Marquez says. “So why would you sell something that’s going to be worth so much more next year than it is today? The majority of people that hold it are long-term investors.”

How Does Bitcoin Work?

Bitcoin is built on a distributed digital record called a blockchain. As the name implies, blockchain is a linked body of data, made up of units called blocks that contain information about each and every transaction, including date and time, total value, buyer and seller, and a unique identifying code for each exchange. Entries are strung together in chronological order, creating a digital chain of blocks. “Once a block is added to the blockchain, it becomes accessible to anyone who wishes to view it, acting as a public ledger of cryptocurrency transactions,” says Stacey Harris, consultant for Pelicoin, a network of cryptocurrency ATMs. Blockchain is decentralized, which means it’s not controlled by any one organization. “It’s like a Google Doc that anyone can work on,” says Buchi Okoro, CEO and co-founder of African cryptocurrency exchange Quidax. “Nobody owns it, but anyone who has a link can contribute to it. And as different people update it, your copy also gets updated.”

Python Hints from pl


Telegram Python Hints
FROM USA