Repository navigation
Commit c653b13
committed
Store cppia object fields directly unless a host field needs conversion
HaxeFoundation/hxcpp#1324 stopped cppia linking object field access to a
direct memory reference, because at API level 500 a host field can hold
a typed function, and storing a script closure into it through an
hx::Object pointer left something that is not callable. Every object
field access then went through a named lookup, in scripts' own classes
and in Haxe 4 builds too, where no field needs that conversion.
Bisecting the new cppia benchmarks between hxcpp 4.3.53 and the fork
point found it: JIT object creation fell from 102M to 30M objects/s.
The direct reference is back for every object field except a host
class's field at API level 500, as the PR suggested. It stores with the
same write barrier as before, in the interpreter and the JIT. With the
previous commit, against hxcpp 4.3.53: JIT object creation 100M (stock
106M), JIT virtual calls 287M (290M), interpreted object creation 17.9M
(18.6M) and interpreted virtual calls 38.5M (38.9M).
CppiaObjectFields stores object, function and array fields from a
script into its own objects and a host object, with minor collections
in between, in the interpreter and the JIT.
Fixes #247
Fixes #2451 parent 8a0a4ee commit c653b13
7 files changed
Lines changed: 88 additions & 0 deletions
File tree
- src/hx/cppia
- test/regression/CppiaObjectFields
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4739 | 4739 | | |
4740 | 4740 | | |
4741 | 4741 | | |
| 4742 | + | |
4742 | 4743 | | |
4743 | 4744 | | |
4744 | 4745 | | |
| |||
4747 | 4748 | | |
4748 | 4749 | | |
4749 | 4750 | | |
| 4751 | + | |
4750 | 4752 | | |
4751 | 4753 | | |
4752 | 4754 | | |
| |||
4787 | 4789 | | |
4788 | 4790 | | |
4789 | 4791 | | |
| 4792 | + | |
| 4793 | + | |
| 4794 | + | |
| 4795 | + | |
| 4796 | + | |
| 4797 | + | |
| 4798 | + | |
| 4799 | + | |
| 4800 | + | |
| 4801 | + | |
| 4802 | + | |
| 4803 | + | |
| 4804 | + | |
| 4805 | + | |
| 4806 | + | |
4790 | 4807 | | |
4791 | 4808 | | |
4792 | 4809 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments