376 karma · joined November 28, 2016
You only need to learn to drive one car, and you can drive them all. But under the hood the cars are completely different. Gas, diesel, battery, hybrid, all have the same API, yet no one says that you copied a car if it has a steering wheel.
One could probably reinvent the (steering) wheel and possibly make a better interface to the car, but that would result in people having to learn how to drive your car specifically.
> The difference between AES128 and AES256 appears to be approximately 26%, rather than the 40% one might expect (AES128 does 10 rounds, AES256 does 14 rounds). There may be some limiting factor that prevents AES128 running at the expected speed, or perhaps this CPU has extra area dedicated to making AES256 faster.
The hardware in the CPU performs a single AES round, it does not dedicate more hardware for AES256. One who understands that AES-GCM is not just AES knows that the difference is due to the GCM overhead, that is the same for 128 and 256.
There is also BoringTun: https://github.com/cloudflare/boringtun which is faster
Disclaimer: I wrote BoringTun
Mio, in theory, is not very far off of what I ended up implementing, but it is missing a few features that I really needed, and building those features on top of Mio would be harder than just using epoll/kqueue directly. Also I don't understand the fear people have of using epoll/kqueue. Those are very basic features that every engineer has to know how to use.
So what are the features:
No locks - Mio polls under lock, but epoll/kqueue are multithread safe by nature as long as you use the correct filters. Mio has considerable overhead over pure epoll/kqueue.
No need for tokens, instead I store closure pointers. Real zero overhead. Of course I could cast pointers to usize and use as Mio tokens, but I would still have to build the ownership model on top, which is most of the work anyway.
Timers in Mio run in a thread??? I use platform idiomatic conventions instead, which with kqueue require direct access to kqueue.
Signal handlers, can't make idiomatic one with Mio (or maybe I missed how).
Same with notifications. Could use something awkward like a channel, but prefer idiomatic approach.
However there is no native support for tunnel interfaces in Windows, and we are still thinking about the best way to add full support.
The WireGuard project for example developed a whole new driver just for that. Don't know if we are going to follow that route.
CI platforms make it super easy.
Cloudflare made a big effort to make all software run on x86 and aarch64, and it wasn't that hard at all. Most things today work out of the box.
Many things that don't work, were not very robust to begin with, and fixing them to work on both platforms only made the software better as a whole.
Cloudflare could move to ARM servers in a days' notice, and would already do that if Qualcomm hasn't closed the Centriq shop.
The only real advantage I see for Intel today is AVX512, which can't be beat for some workloads, SVE would be able to compete for some workloads, but not all. However most workloads don't use vector processing instructions anyway. Still, I hope ARM improves their SIMD architecture further.
As for the ALU performance difference, it is very easy to bridge. As evident by Apple's CPUs and Qualcomm Centriq simply having four ALU units gets you to about the same ALU performance as Intel.
Branch prediction, cache performance and the interconnect are still much better at Intel processors. However Intel already peaked branch prediction performance, so the difference can only get smaller with time.
> The ARM Advanced SIMD architecture, its associated implementations, and supporting software, are commonly referred to as NEON technology. There are NEON instruction sets for both AArch32 (equivalent to the ARMv7 NEON instructions) and for AArch64. Both can be used to significantly accelerate repetitive operations on large data sets. This can be useful in applications such as media codecs.
The NEON architecture for AArch64 uses 32 × 128-bit register, twice as many as for ARMv7. These are the same registers used by the floating-point instructions. All compiled code and subroutines conforms to the EABI, which specifies which registers can be corrupted and which registers must be preserved within a particular subroutine. The compiler is free to use any NEON/VFP registers for floating-point values or NEON data at any point in the code.
Do you have a single number to back that up?
https://github.com/cloudflare/jpegtran/blob/vlad/arm/jchuff_...