-
Notifications
You must be signed in to change notification settings - Fork 31
/
note.txt
137 lines (104 loc) · 3 KB
/
note.txt
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
char
-----------------------
Char in Java: 16-bit unsigned integers
char in Rust: four bytes in size
problem
----------------------
1. System.arraycopy
The performance of JVM depends on arraycopy.
ArrayList<Integer> list = new ArrayList<Integer>();
int start = 0;
while (start < 50000) {
list.add(start++);
}
It's slow to run the code, but Oracle Java very quick.
The reason is that, invoke 'clone' for every OopRef
test case: $JDK_TEST/Character/CheckProp.java
Key Points:
a. create lots of Integer object
b. ArrayList inner buf, new bigger buffer when reach limit,
then, invoke System.arraycopy to move objects
2. dynamic workers in thread pool
spawn & gc worker dynamic
indicators:
a. system payload
b. worker queue
c. thread types (io? calculation?)
jdk
-----------------------
ByteBuffer (along with all IntBuffer, LongBuffer, ...) are generated from X-Buffer.java.template.
GC
-----------------------
paper:
http://users.cecs.anu.edu.au/~steveb/downloads/pdf/rust-ismm-2016.pdf
an example of a high performance GC impl in Rust.
codes:
https://github.com/Manishearth/rust-gc
Simple tracing (mark and sweep) garbage collector for Rust
Milestones
-----------------------
2020.01.30
Add.java run successfully
2020.02.01
github 100 commits
2020.02.09
code lines reach 10k
2020.02.13
HelloWorld run successfully
2020.02.14
Oop::str replaced by java.lang.String
2020.02.15
github 200 commits, First Watchers, CertainLach, thanks!
2020.02.19
Thank Rust CC(https://rust.cc/),get lots of stars
2020.03.01
extract Ref from Oop, access prime value, no need lock anymore
extract DataArea from Frame, printStackTrace has Line Number
Included in 科技爱好者周刊 96th,thank yifeng
http://www.ruanyifeng.com/blog/2020/02/weekly-issue-96.html
2020.03.03
merge first patch from CertainLach, thanks!
2020.03.04
CertainLach translate README & comments to english
2020.03.05
Switch to Oracle JDK
github 300 commits
2020.03.12
support annotation
2020.03.17
extract class-parser crate
2020.03.22
github 400 commits
2020.04.18
github 500 commits
'javap' nearly complete
study how to impl java threads
signature parser
rewrite based nom
support generic
2020.05.10
threads supported
study gc
2020.06.06
simple gc based Rust Arc
avoid lock when access Oop::Ref
2020.06.20
study linux 'perf' && optimize, and performance is
getting better and better
2020.06.25
github 600 commits
improve vm performance
. rm RwLock of Frame's DataArea
. replace Slot::Primitive(vec bytes) by Slot::I32..., avoid vec malloc
. use jvm_initIDs to cache filed's offset(java_io_FileOutputStream)
. reimpl Oop::Ref as Box ptr, avoid lock
. ConstantPoolCache for method & field offset
. Cargo.toml profile.release conf
. cache MethodSignature in Method
MyCheckProp:
#sum_t_list_add = 5494 -> 1507
#sum_t_map_get = 123 -> 27
#sum_t_map_put = 8 -> 3
#sum_t_parse_int = 626 -> 159
#sum_t_println = 3059 -> 768
#sum_t_int2integer = 3201 -> 1255