Closed
Bug 672490
Opened 14 years ago
Closed 7 years ago
Implicit coercion is a little faster than using "as" but they should be the same
Categories
(Tamarin Graveyard :: Virtual Machine, defect, P3)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: treilly, Unassigned)
Details
Attachments
(1 file, 3 obsolete files)
|
904 bytes,
text/plain
|
Details |
| Reporter | ||
Comment 1•14 years ago
|
||
| Reporter | ||
Comment 2•14 years ago
|
||
Thomas-Reillys-Mac-Pro:~ treilly$ ~/builds/tamarin-redux/release/shell/avmshell cast.abc
as: 63
impl: 170
Thomas-Reillys-Mac-Pro:~ treilly$ ~/builds/tamarin-redux/release64/shell/avmshell cast.abc
as: 60
impl: 158
Thomas-Reillys-Mac-Pro:~ treilly$ ~/builds/tamarin-redux/release64/shell/avmshell cast.abc
as: 59
impl: 157
| Reporter | ||
Updated•14 years ago
|
Summary: astype_late beats coerceobj_atom by a lot → Using "as" instead of implicit coercion is much faster
| Reporter | ||
Comment 3•14 years ago
|
||
| Reporter | ||
Comment 4•14 years ago
|
||
results with test 2
$ ~/builds/tamarin-redux/release/shell/avmshell cast.abc
as: 314
impl: 513
$ ~/builds/tamarin-redux/release/shell/avmshell cast.abc
as: 312
impl: 510
$ ~/builds/tamarin-redux/release-debugger/shell/avmshell cast.abc
as: 344
impl: 589
$ ~/builds/tamarin-redux/release64/shell/avmshell cast.abc
as: 239
impl: 399
$ ~/builds/tamarin-redux/release64/shell/avmshell cast.abc
as: 240
impl: 402
| Reporter | ||
Comment 5•14 years ago
|
||
| Reporter | ||
Comment 6•14 years ago
|
||
Okay so the executive summary is that you have to be careful about DCE eliding the astype_late if you never use the value (see test 2). Werner surmises this is due to astype_late being pure.
coerceobj_atom takes a Traits and doesn't have to call toClassITraits but it seems possibly branchier. AvmCore::astype doesn't some nitfy stuff if Traits is a builtin type but the JIT knows that isn't the case so the as case could be even faster.
Both operations could arguably do the atom testing in the JIT'd code and make a direct call to subtypeof for kObjectType atoms. A good first step would be to try to make coerceobj_atom as fast as astype_late.
And then for true glory the fast path of subtypeof could be inlined into the JIT'd code too.
| Reporter | ||
Comment 7•14 years ago
|
||
previous tests/comments were bogus, as operator is slower than implicit cast, vector is even faster, and atom to atom is the fastest. so no really big surprises here really.
Attachment #546778 -
Attachment is obsolete: true
Attachment #546835 -
Attachment is obsolete: true
Attachment #546856 -
Attachment is obsolete: true
| Reporter | ||
Updated•14 years ago
|
Summary: Using "as" instead of implicit coercion is much faster → Implicit coercion is a little faster than using "as" but they should be the same
| Reporter | ||
Updated•14 years ago
|
OS: Mac OS X → All
Priority: -- → P3
| Reporter | ||
Comment 8•14 years ago
|
||
New results with fixed test. So there is a bug that as operator probably slows things down more than it needs to, a specialization of astype for when we know the right hand side is a valid class is probably in order.
$ ~/builds/tamarin-redux/release64/shell/avmshell cast.abc
as: 239
impl: 161
vec: 157
obj: 144
Comment 9•7 years ago
|
||
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•