-
Notifications
You must be signed in to change notification settings - Fork 3
/
DesignPrinciple
69 lines (51 loc) · 2.59 KB
/
DesignPrinciple
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
TODO List:
1. Test
2. JSON
3. Lock
4. Parallel
5. Other support
6. Vim or others
------------------------------------------
I guess I will make some other tasks to implement the DB, like 3.
Also,
7. Memory Pool
8. Thread Pool
9. AIO, IOCP
Are very import in this project.
-------------------------------------------------------------
Basic performance, put 65s/1M, read 33s/1M. Without any external cache. 33% usage. use cache `4s`?
-------------------------------------------------------------
V0.02, add page-cache feature, performance is bad than previous experiment.
Got it why the result looks good in previous failed experiment(Almost not change page, -1).
Advice: use background thread to save page or pageelement into files.
--------------------------------------------------------------
V0.03, add batch mode(maybe slient batch)
Speed performance, 25s/100M, and the speed will be slow enough with the increasing of the test data.
V0.035, the fasted record is 10.5s/100M in my experiment.
--------------------------------------------------------------
V0.04, add multiple-threading programming technology.
Speed is almost same as previous experiment(I guess the parallel technology I take affects it).
Add another mp technolgy, however, the performance is still the same. Bottleneck is in disk?
V0.045, add `log lock` and `cache lock`. The style of `cache lock` is very ugly.
How to use lock(atomic or others)?
--------------------------------------------------------------
V0.05, add async-w/r technology.
--------------------------------------------------------------
V0.06, add compact feature, add log disabled option
Performance, when we disabled the log, the read performance has obvious advancement.
Great, achieve compact. However. the efficiency of compact is very slow when we use batch in write phase. However, it can achieve 34M/57M performance in general put method. Further optimization can be adopted. However, very hard and time-consuming.
--------------------------------------------------------------
V0.07 Add fast search in Split
10%~20% performance improvement. Not very ideal.
--------------------------------------------------------------
Best practise in coding life,
1. Build it
2. Write(find) a basic test to testify it
--------------------------------------------------------------
Bottleneck has been found, the updated time of page.
Three method to remedy it.
1. AIO
2. Use fcntl(However, need much times to implement it.)
3. MMAP + dup, maybe.
--------------------------------------------------------------
Zero Tolerable Policy.