Jiajun Yao

Stay hungry, Stay foolish.

Response Time and Throughput

For the discussion of this post, response time is the time between a service receiving a request and returning a response. It is the sum of waiting time and processing time. Waiting time is how long the request waits in queues before being processed. Processing time is the time to actually do the work of the request. Throughput is the number of requests that are completed per unit time. This post discusses how they can be possibly related.

Nondeterministic Code

Nondeterministic code is hard to debug since bugs are not consistently reproducible. It’s easy to notice that the code is perhaps nondeterministic if multi-threading or random functions are involved. However we can still write nondeterministic single-threaded code without using random functions.

Good Economics for Hard Times

2020,世界很复杂。贸易战,美国大选,全球气候变暖,贫富差距扩大化等热点问题影响着我们每一个人。如果你也对这些问题感兴趣,我推荐你阅读《Good Economics for Hard Times》。这本书可能会带给你一些不同的角度来看待这些问题,有些甚至可能完全颠覆你以往的认知。以下是我的读书笔记:

  1. 移民
  2. 全球化
  3. 偏见
  4. 经济增长
  5. 气候变暖
  6. 贫富差距

Linux PID

In the Linux world, pid means two things. It’s the id of a process from POSIX’s point of view and the id of a task from kernel’s point of view.


Microbenchmark is used to measure the performance of a small piece of code for the purpose of performance optimization. Writing a good microbenchmark is hard and that’s why we should use microbenchmark frameworks (e.g. JMH for Java and Google Benchmark for C++) to help us. This post contains microbenchmarks that I think are interesting.