Performance from Aligning Smalltalk & Javascript Classes
- Dr. Dave Mason
Department of Computer Science Ryerson University
1 / 20
Performance from Aligning Smalltalk & Javascript Classes Dr. - - PowerPoint PPT Presentation
Performance from Aligning Smalltalk & Javascript Classes Dr. Dave Mason Department of Computer Science Ryerson University 1 / 20 Motivation building a dataflow environment (similar to this mornings talk) for the web Amber is very
1 / 20
Introduction 2 / 20
Introduction 2 / 20
Introduction 2 / 20
Introduction 3 / 20
Introduction JS Inheritance 4 / 20
ProtoObject methods fields ProtoObject class methods Object methods fields Object class methods an Object Behavior methods fields Behavior class methods Class methods fields Class class methods Metaclass methods fields Metaclass class methods UndefinedObject methods fields UndefinedObject class methods nil UserCls methods fields UserCls class methods a UserCls fields
Introduction Smalltalk Classes 5 / 20
Introduction Smalltalk Classes 6 / 20
Introduction Smalltalk Classes 6 / 20
Introduction Smalltalk Classes 6 / 20
Introduction Smalltalk Classes 6 / 20
Introduction Smalltalk Classes 6 / 20
Introduction Smalltalk Classes 6 / 20
Introduction Smalltalk Classes 7 / 20
Introduction Smalltalk Classes 7 / 20
Introduction Smalltalk Classes 7 / 20
Introduction Smalltalk Classes 7 / 20
Introduction Smalltalk Classes 7 / 20
Introduction Smalltalk Classes 7 / 20
Introduction Smalltalk Classes 7 / 20
Introduction Smalltalk Classes 7 / 20
ProtoObject __proto__ prototype constructor methods/fields Class prototype ProtoObject prototype __proto__ constructor methods null ProtoObject class __proto__ prototype constructor Metaclass prototype Metaclass Object __proto__ prototype constructor methods/fields Object pro- totype __proto__ constructor methods Object class __proto__ prototype constructor UserCls __proto__ prototype constructor methods/fields UserCls prototype __proto__ constructor methods UserCls class __proto__ prototype constructor a UserCls __proto__ fields another UserCls __proto__ fields an Object __proto__ fields a non-Smalltalk Object __proto__ fields
Introduction Amber-Direct Smalltalk Class Structure 8 / 20
Introduction 9 / 20
Timings 10 / 20
Timings Booleans 11 / 20
Timings 12 / 20
Timings doesNotUnderstand: 13 / 20
Timings doesNotUnderstand: 14 / 20
amber $amber(f).foo() eq2 (f==null?nil:f).foo()
(f||(f==null?nil:f)).foo()
(f||(f===undefined||f===null?nil:f)).foo()
(f||(f===null||f===undefined?nil:f)).foo()
(f||(f===null?nil:f===undefined?nil:f)).foo() recv $recv(f).foo() recvOr $recvOr(f).foo()
(f||$recv(f)).foo()
Timings null, undefined 15 / 20
Timings Access to instance variables 16 / 20
Timings Optimizing Numeric Calculations 17 / 20
Conclusions 18 / 20
Conclusions 19 / 20
Conclusions 20 / 20