Sonia Software Notes
2.02K subscribers
307 photos
16 videos
46 files
531 links
Download Telegram
👍25😁9
Forwarded from Semicolon (Ali Moeinian)
روز معلم فقط مبارک خودت باشه :) ❤️
47👍3😁3👎1🔥1
Latency numbers every developer should know.
👍7🔥1
Sonia Software Notes
Latency numbers every developer should know.
🔹L1 and L2 caches: 1 ns, 10 ns
E.g.: They are usually built onto the microprocessor chip. Unless you work with hardware directly, you probably don’t need to worry about them.

🔹RAM access: 100 ns
E.g.: It takes around 100 ns to read data from memory. Redis is an in-memory data store, so it takes about 100 ns to read data from Redis.

🔹Send 1K bytes over 1 Gbps network: 10 us
E.g.: It takes around 10 us to send 1KB of data from Memcached through the network.

🔹Read from SSD: 100 us
E.g.: RocksDB is a disk-based K/V store, so the read latency is around 100 us on SSD.

🔹Database insert operation: 1 ms.
E.g.: Postgresql commit might take 1ms. The database needs to store the data, create the index, and flush logs. All these actions take time.

🔹Send packet CA->Netherlands->CA: 100 ms
E.g.: If we have a long-distance Zoom call, the latency might be around 100 ms.

🔹Retry/refresh internal: 1-10s
E.g: In a monitoring system, the refresh interval is usually set to 5~10 seconds

Notes
-----
1 ns = 10^-9 seconds
1 us = 10^-6 seconds = 1,000 ns
1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns

#LatencyNumbers
👍4🔥1
Forwarded from Sadra Codes
از localhost استفاده نکنید!

توی تقریبا تمام سیستم‌عامل‌ها و اینترفیس‌های شبکه، localhost دو آدرس آی‌پی v4 و v6 برمیگردونه و اکثر ابزارها و فریم‌ورک ها میان اول v6 رو تست می‌کنن، اگه جواب نداد و fail شد، میرن سراغ v4.

IPv4 -> 127.0.0.1
IPv6 -> ::1

این به این معنیه که یه عملیات lookup این وسط انجام میشه و خب یکم زمان‌بره. اگه سر چک کردن IPv6 به Failure بخوره، بازم زمان‌بره. حالا اگه اون فریم‌ورک یا ابزار خاص فقط v6 رو چک کنه و بیخیال v4 بشه چی؟!‌ ممکنه دوباره Failure بخوره و سیستم اونجور که باید، کار نکنه.

حال چه کنیم..؟!

خیلی راحت، از 127.0.0.1 استفاده کنید. دیگه نه فریم‌ورکی lookup انجام می‌ده (چون آدرس IP هست نه HOSTNAME) نه چیزی Fail میشه.
👍24👎32🔥1
🤣16👻2
The illusion of free choice
👌47👍4🍌4🔥1🍓1
NodeOS
https://node-os.com/

lightweight operating system using Node.js as userspace ;/

نظر شخصی :
فاجعه سازی نکنید :)
#nodeos
#nodejs
😐26😁3🔥1🦄1
😁27🤣13👍1🔥1
Forwarded from Sadra Codes
یه زمان، سیستم توی سی اینجور بود که شما باید از Malloc استفاده می‌کردید و از CPU درخواست فضا از رم واسه متغیرتون می‌کردید. بصورت دستی ست می‌کردید که فلان متغیر، فلان قدر از رم رو (به بایت) بهش اختصاص بده.

int age = malloc(32670) // 32kb

و باید حتما یادتون می‌موند وقتی که کارتون با این متغیر (دیتا) تموم شد، حتما این رفرنسش رو پاک کنید تا اون بلاک از مموری هم پاک شه.

free(age) // used to free the memory block

حالا این وسط یه سری بدبختیا بود..

- اگه برنامه‌نویس یادش می‌رفت فانکشن free رو ران کنه: خب خیلی طبیعیه که اگه یادش می‌رفت free-up کنه، به مموری لیک می‌خوردیم. گاها دیدید RAM Resource پر میشه و سیستم دیتا رو روی Swap نگه‌داری می‌کنه؟ دقیقا همون لحظه‌س.

- اگه برنامه‌نویس بلافاصله بعد از تعریف متغیر، free رو کال می‌کرد: به راحتی اون بلاک از مموری آزاد می‌شد و شما اگه جلوتر مقدار متغیر رو چاپ کنید ممکنه یه دیتاهایی پرینت شن که خیلی عجیب و غریب باشن..!! (درواقع ممکنه دیتاهایی باشن که توسط دیگر پروسه‌ها دارن توی اون بلاک از رم نگه‌داری میشن)

- اگه برنامه‌نویس دو بار free رو کال کنه: اگه بار اول فری کال شه، بلاک رم آزاد میشه و دیتایی که داخلشه از بین میره. فرض کنید بین free اول و free دوم یه وقفه ایجاد شه و سیستم‌عامل یا هر پروسه دیگه‌ای بیاد و دقیقا توی اون بلاک از رم یه دیتای حساس قرار بده. بلافاصله بعد از اینکه free دوم ران میشه، اون دیتای حساس هم از بین میره و پروسه عملا به فنا می‌ره و این اصلا خوب نیس!

خلاصه امروز که می‌بینید خیلی راحت زبان‌ها این Memory Management رو هندل می‌کنن، همچین دارک هیستوری پشت قضیه بوده.. دلیلشم اینه که سیستم‌عامل یکم واسش دردسر داره که بتونه منیج کنه مموری رو. واسه همینه که اکثر استراتژی‌های فری آپ کردن مموری توسط خود زبان‌های برنامه‌نویسی انجام میشه.
👍86👎2😎1
Forwarded from Sudoer - Powered OFF (Morteza Bashsiz)
درود

طبق این مقاله که توسط محققین USENIX منتشر شده،‌ فایروالهای چینی (GFW) که ظاهرا در سیستم فیلترینگ ایران هم از این نوع فایروال‌ها استفاده میشه،‌ قابلیتی بهشون اضافه شده که امکان تشخیص و مسدود کردن سریع پروتوکل‌های ضد فیلتر مثل Shadowsocks و Outline و VMess رو فراهم میکنه.
من سعی میکنم این مقاله رو مطالعه کنم و اطلاعات کامل‌تری رو در اختیارتون قرار بدم
https://gfw.report/publications/usenixsecurity23/en/

سپاس فراوان
💔10🤔6😢3👎2
Forwarded from Sudoer - Powered OFF (Morteza Bashsiz)
درود
اطلاع‌رسانی

نسخه گولنگ اسکنر بروز شد

فیکس باگ ساخت پوشه result , config در سیستم عامل windows
ادیت لاجیک sort آی پی ها که قبلا بعد از اتمام اسکن آی پی ها صورت میگرفت اما الان با هر آی پی که برنامه پیدا میکند sort میشود

https://github.com/MortezaBashsiz/CFScanner/releases/tag/v23.05.11

سپاس
🆒3❤‍🔥1
😁17🤣3🤝3👍2❤‍🔥1
Modern C++ Tutorial: C++11/14/17/20 On the Fly
https://github.com/changkun/modern-cpp-tutorial

The book claims to be "On the Fly". It intends to provide a comprehensive introduction to the relevant features of modern C++ (before 2020s). Readers can choose interesting content according to the following table of content to learn and quickly familiarize the new features you would like to know. Readers should be aware that not all of these features are required. Instead, it should be learned when you really need it.

At the same time, instead of coding only, the book introduces the historical background of its technical requirements (as simple as possible), which provides great help in understanding why these features came out.

#Cpp
72❤‍🔥1👌1👨‍💻1
Google I/O 2012 - Go Concurrency Patterns by Rob Pike
https://youtu.be/f6kdp27TYZs

Concurrency is the key to designing high performance network services. Go's concurrency primitives (goroutines and channels) provide a simple and efficient means of expressing concurrent execution. In this talk we see how tricky concurrency problems can be solved gracefully with simple Go code.

#Golang
#Concurrency
31
👍11😁3🌚2🤪21
Programming languages used in most popular websites

https://en.wikipedia.org/wiki/Programming_languages_used_in_most_popular_websites

آخرین آپدیت این ویکی ۱۳ می ۲۰۲۳ میباشد.
🆒9👍5👎4🗿2
😁40🔥2💯1🍌1🎅1
🌚9👎1😱1💘1