Skip to content

Commit

Permalink
docs: fix link on PerformanceCriticalPath (tikv#11141)
Browse files Browse the repository at this point in the history
Fixes link and improve content layout.

This closes tikv#11140 .

Signed-off-by: tison <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
  • Loading branch information
tisonkun and ti-chi-bot authored Oct 27, 2021
1 parent 3dbe6e2 commit 059246c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions PERFORMANCE_CRITICAL_PATH.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Performance Critical Path of user requests
There're many files whose functions are in the critical path of read or write requests. They're so important to the overall performance that any regression will directly impact user experience. We add a comment #[PerformanceCriticalPath] to highlight these critical files. Please note that this is the best-effort work and some files in critical path may not be marked. But if a file is marked, please pay special attention when you change its code.

Here're some typical mistakes that should be avoided in the #[PerformanceCriticalPath] files.
There're many files whose functions are in the critical path of read or write requests. They're so important to the overall performance that any regression will directly impact user experience. We add a comment `#[PerformanceCriticalPath]` to highlight these critical files. Please note that this is the best-effort work and some files in critical path may not be marked. But if a file is marked, please pay special attention when you change its code.

Here're some typical mistakes that should be avoided in the `#[PerformanceCriticalPath]` files:

* Unnecessary synchronous I/O. Here 'unnecessary' means it's not a MUST for serving the current user request. For example, on_gc_snap() in peers.rs should spin off its I/O related work to background thread.
* Verbose logging with info or above log level.
* Global lock.
* Long tasks that do not have to be synchronous (Could be done in background thread instead).

Here's the [performance map](images/tikv_Map.png) that would help you to understand how read/write requests are executed inside Tikv.
Below is the performance map that would help you to understand how read/write requests are executed inside TiKV:

![performance map](images/tikv_map.png)

0 comments on commit 059246c

Please sign in to comment.