author | Tony Garnock-Jones <tonygarnockjones@gmail.com> |
Wed, 16 Jan 2019 17:15:58 +0000 | |
changeset 438 | 1fe179d53161 |
parent 430 | b57692a51f6b |
permissions | -rw-r--r-- |
382
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
1 |
2018-07-13 22:30:40 tonyg on hop: 0 tinyBenchmarks 411861 bytecodes/sec; 65707 sends/sec |
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
2 |
|
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
3 |
Added simplest possible method lookup cache; the result: |
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
4 |
2018-07-13 22:43:12 tonyg on hop: 0 tinyBenchmarks 859845 bytecodes/sec; 106388 sends/sec |
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
5 |
|
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
6 |
For comparison, on the same machine (hop), SqueakJS running Mini Squeak 2.2 |
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
7 |
in Firefox Quantum 61.0.1 gets 38787878 bytecodes/sec; 698205 sends/sec |
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
8 |
|
380 | 9 |
2018-07-14 16:52:47 tonyg on leap: 0 tinyBenchmarks 2228412 bytecodes/sec; 270007 sends/sec |
10 |
||
11 |
Split out perform-primitive into separate routine |
|
12 |
2018-07-14 17:05:40 tonyg on leap: 0 tinyBenchmarks 2386634 bytecodes/sec; 287921 sends/sec |
|
13 |
||
14 |
First measurable instance of JIT |
|
15 |
2018-07-14 23:29:08 tonyg on leap: 0 tinyBenchmarks, five runs: |
|
16 |
5131494 bytecodes/sec; 603554 sends/sec |
|
17 |
5009392 bytecodes/sec; 706843 sends/sec |
|
18 |
5161290 bytecodes/sec; 646828 sends/sec |
|
19 |
5151320 bytecodes/sec; 641582 sends/sec |
|
20 |
5028284 bytecodes/sec; 705873 sends/sec |
|
21 |
||
22 |
Remove spurious indirection ("resume-jit-context"): |
|
23 |
2018-07-14 23:48:56 tonyg on leap: 0 tinyBenchmarks 7944389 bytecodes/sec; 929888 sends/sec |
|
24 |
||
25 |
Remove spurious arglist construction/destruction, introduce MICs: |
|
26 |
2018-07-15 00:43:31 tonyg on leap: 0 tinyBenchmarks |
|
27 |
19277108 bytecodes/sec; 2778454 sends/sec |
|
28 |
19417475 bytecodes/sec; 2738288 sends/sec |
|
29 |
||
30 |
Inline primitive definitions: |
|
31 |
2018-07-15 01:22:29 tonyg on leap: 0 tinyBenchmarks |
|
32 |
at startup: |
|
33 |
24060150 bytecodes/sec; 3184661 sends/sec |
|
34 |
23970037 bytecodes/sec; 3243944 sends/sec |
|
35 |
in a workspace: |
|
36 |
19765287 bytecodes/sec; 3482507 sends/sec |
|
37 |
19476567 bytecodes/sec; 3422322 sends/sec |
|
382
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
38 |
|
a079923f9086
Performance notes from hop
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
380
diff
changeset
|
39 |
2018-07-15 11:12:26 tonyg on hop: 0 tinyBenchmarks 7816316 bytecodes/sec; 1313400 sends/sec |
384
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
40 |
|
397
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
41 |
2018-07-15 12:30:53 Reading some of "the classics" [1,2,3] to refresh |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
42 |
my memory. The first paper [1] presents the techniques of |
384
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
43 |
*customization*, *inlining*, and *splitting*: |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
44 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
45 |
- *Customization* means compiling a specific version of each method |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
46 |
for each distinct concrete receiver class. In |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
47 |
`jit-SmallWorld-2015.rkt`, this would correspond to including a |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
48 |
`class` argument to `compile-native-proc`. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
49 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
50 |
Their example of `#min:` is instructive. Consider `#min:` inherited |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
51 |
by, say, `SmallInt` and `String`: |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
52 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
53 |
min: x |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
54 |
^ (self < x) ifTrue: [self] ifFalse: [x] |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
55 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
56 |
By using customization, the system can directly link to (at least) |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
57 |
or inline (better) the `SmallInt`- and `String`-specific |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
58 |
implementations of `#<`. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
59 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
60 |
- *Inlining* comprises both inlining of a method implementation into |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
61 |
a call site, where the receiver class of the inlined method is |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
62 |
statically known, and open-coding of primitives at call sites. In |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
63 |
`jit-SmallWorld-2015.rkt`, primitives are open-coded, but other |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
64 |
methods are not yet inlined, because no type information is |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
65 |
propagated inside the compiler. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
66 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
67 |
- *Splitting*—properly *message splitting*—is the hoisting of pieces |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
68 |
of a continuation into alternative branches leading up to that |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
69 |
continuation. It corresponds to a kind of |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
70 |
CPS-transformation-induced binding-time improvement: it's the kind |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
71 |
of thing that happens if you do the CPS transformation, and then |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
72 |
specialize it ("customize" it!) based on type information gleaned |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
73 |
from each branch. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
74 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
75 |
In the `#min:` example, after inlining and open-coding the |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
76 |
primitive `#<` for `SmallInt` receivers, we have two branches: one |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
77 |
where the comparison yielded the `true` object, and one where it |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
78 |
yielded `false`. Without splitting, the subsequent |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
79 |
`#ifTrue:ifFalse:` can't be inlined effectively (though [IDEA] a |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
80 |
partial evaluator able to represent *alternatives*—*unions*—might |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
81 |
be able to do well! The result would be (U True False) and a simple |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
82 |
cascade of tests could recover quite a bit of efficiency). By |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
83 |
splitting, hoisting the `#ifTrue:ifFalse:` send into the branches |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
84 |
producing the `true` and `false` values, we get to inline the |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
85 |
constant blocks that are its arguments. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
86 |
|
397
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
87 |
It also mentions other techniques: |
384
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
88 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
89 |
- "type prediction" based on hand-coded heuristics about common uses |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
90 |
of certain selectors. Our `jit-SmallWorld-2015.rkt` (and the pure |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
91 |
interpreter it descends from, and the SmallWorld implementations of |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
92 |
Budd and Allen that *that* descends from) all benefit from this: |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
93 |
the `SendUnary` and `SendBinary` opcodes (10 and 11) include |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
94 |
special checks for `SmallInt` instances. Reading the introduction |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
95 |
to [2] suggests that this kind of type prediction will be obviated |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
96 |
by dynamic type feedback. We shall see. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
97 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
98 |
- "extended splitting" is essentially even more like CPS-based |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
99 |
binding-time improvement: whole chains of operations, larger |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
100 |
segments of continuations, are hoisted above merge nodes in the |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
101 |
control flow graph. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
102 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
103 |
- with some small additional effort (?), the optimizations combine to |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
104 |
hoist some loop invariants from a loop body into its header, |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
105 |
apparently. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
106 |
|
397
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
107 |
The authors briefly describe their "adaptive recompilation" technique |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
108 |
of the time. Two compilers are used; the non-optimizing compiler adds |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
109 |
code to increment a per-method (presumably, a *customized* method?) |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
110 |
counter on each entry to the unoptimized routine. Later checking of |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
111 |
the counters identifies hot spots. |
384
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
112 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
113 |
QUESTIONS: How does it figure out which receiver-type to optimize for? |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
114 |
How many counters per implementation are there - one per |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
115 |
receivertype/implementation pair, or just one for the implementation |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
116 |
itself? |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
117 |
|
397
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
118 |
On to the second paper [2], on *type feedback*, the use of information |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
119 |
about concrete implementation types gathered at runtime to improve the |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
120 |
outcome of recompilation. At the end of the introduction, the paper |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
121 |
claims that the new system runs 1.5 times faster than the old system, |
384
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
122 |
despite the simplicity of the new system, because of the power of type |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
123 |
feedback. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
124 |
|
397
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
125 |
- The built-in PICs are used to gather type profile information at |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
126 |
each call site. A list of receiver types, with optional invocation |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
127 |
counts, for each send site is all that is required for the type |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
128 |
feedback technique. |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
129 |
|
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
130 |
- A fairly simple mechanism (p.3) is used to find "hot" methods. |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
131 |
Then, to decide what to recompile (not simply the hot method!), the |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
132 |
system walks the call chain. A caller is recompiled if it "performs |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
133 |
many calls to unoptimized or small methods", or if it creates |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
134 |
closures, since these often encode control. |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
135 |
|
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
136 |
- It recompiles multiple activation records at once, in general: it |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
137 |
is able to inline already-active routines into a recompiled |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
138 |
"great-grand-caller". The paper remarks that this is the inverse of |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
139 |
"dynamic deoptimization" [3]. |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
140 |
|
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
141 |
- The results of recompilation are checked, and if the improvement |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
142 |
(in terms of non-inlined sends) is zero, a recompiled method is |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
143 |
marked so that future optimization attempts don't waste work |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
144 |
re-recompiling it. |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
145 |
|
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
146 |
- "Small" methods are inlined, so long as the overall method isn't |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
147 |
growing "too large". Estimates of the cost of inlining depend not |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
148 |
only on the size of the source text to be inlined *inter alia*, but |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
149 |
on previously-compiled object code for the to-be-inlined method. |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
150 |
|
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
151 |
Ultimately, customization and type feedback seem very similar. |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
152 |
Customization allows static knowledge of the receiver type for |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
153 |
self-sends. Type feedback allows (probabilistic) static knowledge of |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
154 |
the receiver type for other sends. |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
155 |
|
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
156 |
Moving on to the third paper [3]. ((TBD)) |
384
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
157 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
158 |
[1] Ungar, David, Randall B. Smith, Craig Chambers, and Urs Hölzle. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
159 |
“Object, Message, and Performance: How They Coexist in Self.” Computer |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
160 |
25, no. 10 (1992): 53–64. https://doi.org/10.1109/2.161280. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
161 |
|
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
162 |
[2] Hölzle, Urs, and David Ungar. “Optimizing Dynamically-Dispatched |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
163 |
Calls with Run-Time Type Feedback.” In Proceedings of the ACM SIGPLAN |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
164 |
1994 Conference on Programming Language Design and Implementation, |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
165 |
p:326–336. ACM New York, NY, USA, 1994. |
2d82efe83d59
Notes on Self techniques
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
382
diff
changeset
|
166 |
http://portal.acm.org/citation.cfm?id=178478. |
397
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
167 |
|
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
168 |
[3] Hölzle, Urs, Craig Chambers, and David Ungar. ‘Debugging Optimized |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
169 |
Code with Dynamic Deoptimization’. In Proceedings of the ACM SIGPLAN |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
170 |
1992 Conference on Programming Language Design and Implementation. San |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
171 |
Francisco, California, 1992. https://doi.org/10.1145/143095.143114. |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
172 |
|
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
173 |
2018-07-18 18:15:23 On leap: |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
174 |
- from startup: 19115890 bytecodes/sec; 2378566 sends/sec |
4f9067ab5866
Update NOTES.md
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
384
diff
changeset
|
175 |
- in a workspace: 15267175 bytecodes/sec; 2258839 sends/sec |
398
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
176 |
|
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
177 |
... but later measurement shows it running a bit faster (see table |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
178 |
below), so basically benchmarking on this laptop is difficult and |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
179 |
futile and I shouldn't be doing it. |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
180 |
|
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
181 |
Command: |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
182 |
racket jit-SmallWorld-2015.rkt t.st |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
183 |
and t.st contains: |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
184 |
EVAL [ 0 tinyBenchmarks. Transcript show: 0 tinyBenchmarks ] value |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
185 |
|
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
186 |
At rev 377:8accd6d3f51d (startup): 6884681 bytecodes/sec; 856333 sends/sec |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
187 |
At rev 378:2a35e7fcba59 (startup): 7168458 bytecodes/sec; 896649 sends/sec |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
188 |
At rev 379:e5e063ac93ef (startup): 20618556 bytecodes/sec; 2569214 sends/sec |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
189 |
At rev 392:618244a1ee07 (startup): 19358741 bytecodes/sec; 2825302 sends/sec |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
190 |
At rev 394:97ec29b53c47 (startup): 18648018 bytecodes/sec; 2573311 sends/sec |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
191 |
At rev 395:3979401d44c1 (startup): 17887087 bytecodes/sec; 2562715 sends/sec |
208ad46c5fcd
More measurements.
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
397
diff
changeset
|
192 |
At rev 396:3bfb9afdbd9d (startup): 18823529 bytecodes/sec; 2684483 sends/sec |
401
a97ca1ce9699
Java tinyBenchmarks results (needed a bit of hacking to get numbers out of it)
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
398
diff
changeset
|
193 |
|
a97ca1ce9699
Java tinyBenchmarks results (needed a bit of hacking to get numbers out of it)
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
398
diff
changeset
|
194 |
2018-07-19 19:17:27 On leap, running the Java SmallWorld |
a97ca1ce9699
Java tinyBenchmarks results (needed a bit of hacking to get numbers out of it)
Tony Garnock-Jones <tonygarnockjones@gmail.com>
parents:
398
diff
changeset
|
195 |
`0 tinyBenchmarks`, I get 2388059 bytecodes/sec; 299492 sends/sec. |
430 | 196 |
|
197 |
2018-07-29 22:18:12 On leap, plugged in, pe-SmallWorld-2015.rkt, 429:ffe1b880d9c6 (startup): |
|
198 |
34725990 bytecodes/sec; 8049239 sends/sec |