DEV Community

loading...

DA09 Performance in EA

declair profile image Jihao ・1 min read

本篇主要讲企业级应用(Enterprise Applications, EAs)中与性能有关的问题。

Performance Engineering

When do we need to care about Performance ?

  • Requirement: Indentify what is "fast-enough";
  • Design: The archetecture and design of an application will have a considerable impact on performance;
  • After debugging: Engineers should measure where the program is spending its time, and try to speed up any parts that consume nontrivial amounts of time.

During implementation, we do NOT need to care about Performance, because it is hard to indentify performance bottlenecks in the code before a program is working completely.

Design Principles:

Bell's Principle:

The cheapest, fastest, and most reliable components are those that aren't there.

Simple designs often show better performance than more complicated designs.

最便宜,最快和最可靠的组件是不存在的。简单的设计往往会比复杂的设计更好。

Pipelines

Pipelining turns a problem whose performance is limited by latency into a problem whose performance is limited by throughput.

利用 吞吐量 来解决 延迟 带来的性能不足。

类似于使用异步来代替同步

Pipelines的缺点或局限在于我们要保证每一个request是独立的,后续的request不能依赖与前面request的response。同时,Pipelines实现起来也比较复杂。

Cache

缓存,类似于CPU里面的高速缓存。

Discussion

pic
Editor guide