Posts

Detailed HTTP/2 header compression algorithm-HPACK

In HTTP/1.1 (see [RFC7230]), the header field is not compressed. As the number of requests within a web page grows to the point where tens to hundreds of requests are needed, redundant header fields in these requests consume bandwidth unnecessarily, thereby significantly increasing latency.

TLS 1.3 Handshake Protocol

The handshake protocol is used to negotiate the security parameters of the connection. The handshake messages are provided to the TLS recording layer, where they are encapsulated into one or more TLSPlaintext or TLSCiphertext, and they are processed and transmitted according to the current active connection state. Protocol messages must be sent in a certain order (see below for the order). If the peer finds that the received handshake messages are not in the right order, they must use the “unexpected_message” alert message to abort the handshake.

How to understand gradient descent?

Gradient descent is a first-order iterative optimization algorithm for finding a local minimum of a differentiable function. To find a local minimum of a function using gradient descent, we take steps proportional to the negative of the gradient (or approximate gradient) of the function at the current point. But if we instead take steps proportional to the positive of the gradient, we approach a local maximum of that function; the procedure is then known as gradient ascent. Gradient descent is generally attributed to Cauchy, who first suggested it in 1847, but its convergence properties for non-linear optimization problems were first studied by Haskell Curry in 1944.

How to design and implement a thread-safe Map data structure

Map is a very common data structure used to store some unordered key-value pairs. In mainstream programming languages, it comes with its implementation by default. STL in C and C++ implements Map, JavaScript also has Map, Java has HashMap, Swift and Python have Dictionary, Go has Map, and Objective-C has NSDictionary and NSMutableDictionary. Are all the above maps thread-safe? The answer is no, not all thread-safe. How can a thread-safe Map be implemented? To answer this question, you need to start with how to implement a Map.

Weex layout engine powered by FlexBox algorithm

In the last article, we talked about the basic process of Weex working on the iOS client. This article will analyze in detail how Weex lays out the native interface with high performance, and then will compare with the existing layout methods to see how Weex layout performance is. Open the Layout folder of Weex’s source code, and you will see two c files. These two files are the Weex layout engine we are going to talk about today.