uvloop: Blazing fast Python networking — magicstack

TL;DR

asyncio is an asynchronous I/O framework shipping with the Python Standard Library. In this blog post, we introduce uvloop: a full, drop-in replacement for the asyncio event loop. uvloop is written in Cython and built on top of libuv.

uvloop makes asyncio fast. In fact, it is at least 2x faster than nodejs, gevent, as well as any other Python asynchronous framework. The performance of uvloop-based asyncio is close to that of Go programs.

Source: uvloop: Blazing fast Python networking — magicstack

 

In Defense of C++

I really like C++. It’s not the right tool for every job, but it’s what I reach for when I need to do any kind of systems programming. Unfortunately, C++ has often been cited as a “bad” language, and I feel like that reputation has worsened over time. Recent languages like Go and Rust have taken over a lot of mind share—at least on sites like Hacker News. These are great languages, and I’m happy to see them succeed. But I think a lot of people miss the point of what makes C++ such a great language, and in this post I want to explain things from my point of view.

To make my point, I’m going initially focus on some commonly cited reasons for C++ is an awful language. Then we’ll see why these supposedly awful things are intentional language design decisions that actually make the language rather interesting and unique.

C++ Is Designed For Performance

When you’re designing a programming language, there are a lot of different trade-offs you have to balance. Things like expressiveness, readability, consistency, and performance are among the factors under consideration. C++ is what you get when, at every turn in the language design road, you choose to take the path that leads to higher performance.

One significant difference with C++ compared to most other programming languages, is that C++ has been designed by the people writing C++ compilers. There is no reference implementation of C++. Instead, there are a lot of different C++ compilers written by different vendors. All of these compilers implement the language slightly differently, generate slightly different code, and usually extend the language slightly.

Source: In Defense of C++

 

Unlearning descriptive statistics

If you’ve ever used an arithmetic mean, a Pearson correlation or a standard deviation to describe a dataset, I’m writing this for you. Better numbers exist to summarize location, association and spread: numbers that are easier to interpret and that don’t act up with wonky data and outliers.

Statistics professors tend to gloss over basic descriptive statistics because they want to spend as much time as possible on margins of error and t-tests and regression. Fair enough, but the result is that it’s easier to find a machine learning expert than someone who can talk about numbers. Forget what you think you know about descriptives and let me give you a whirlwind tour of the real stuff.

The average

The arithmetic mean is one of many measures of central tendency. One particularly useful feature of the mean is that, whenever we lack outside information like a scientific theory, it is our best possible guess for what to expect in the future. Sum up all of the rainy days in your area for as many years as you have data for, divide by the amount of years, and that’s your best bet for how much rain to expect this year. Multiply by 10, and that’s how much rain you can expect in a decade.

Source: Unlearning descriptive statistics