SlideShare a Scribd company logo
1 of 21
Download to read offline
Unanticipated Partial
Behavioral Reflection


    David Röthlisberger
    Marcus Denker
    Eric Tanter




© Marcus Denker
Roadmap


> Example
> Behavioral Reflection
     — Smalltalk / Metaclasstalk
     — Unanticipated Reflection
     — Partial Reflection
> Unanticipated Partial Behavioral Reflection
> Example revisited
> Benchmarks
> Conclusion



© Marcus Denker
Running Example




>    Typical web application (e.g. Wiki)

>    Shows performance problem under high load

>    Goals:
     — Profile and fix the problem
     — No restart / interruption of service




© Marcus Denker
Towards a Solution



>    Analyse the problem
     — Install profiler
     — Analyze
     — Retract profiler


>    Solve the problem
     — Introduce a caching mechanism
     — Experiment with multiple solutions




© Marcus Denker
Reflection



>    Reflection: computation about computation
     — base level / meta level
     — causally connected


>    Structural Reflection
     — Reification of structure

>    Behavioral Reflection
     — Reification of execution


© Marcus Denker
Unanticipated Reflection


>    “Unanticipated Use” means:
     — No need to know in advance (and plan for) reflection
     — Possible to be done at runtime

>    Java: reflection only at load time
     — No runtime change in general
     — Need to compile in hooks for reflection

>    Smalltalk reflection is unanticipated
     — taken for granted. But it’s quite cool!


© Marcus Denker
Reflection in Smalltalk


>    Structural Reflection
     — Classes / Methods are objects
     — Can be changed at runtime


>    Behavioral Reflection
     — No model of execution below method body
     — message sending / variable access hard coded by VM
     — #doesNotUnderstand / MethodWrappers

>    Reflective capabilities of Smalltalk should be improved!


© Marcus Denker
MetaclassTalk


>    Extends the Smalltalk metaclass model

>    Metaclass defines
     — message lookup
     — access to instance variables

>    Problems:
     — Reflection only controllable at class boundaries
     — No fine-grained selection (e.g. single operations)
     — Protocol between base and meta level is fixed


© Marcus Denker
Partial Reflection


> Hooksets: collection of operation occurrences
> Links
     — Bind hooksets to metaobjects
     — Define Protocol between base and meta
                                                  metaobject
>    Goals
     — Highly selective reification   links        activation
                                                  condition
     — Flexiblel metalevel engineering
           –      Protocol specification            hookset
           –      Cross-cutting hooksets



© Marcus Denker
Geppetto


>    Partial Behavioral Reflection pioneered in Java
     — Code transformation at load time
     — Not unanticipated (it’s Java...)

>    Geppetto: Partial Behavioral Reflection for Smalltalk

>    For Squeak 3.9 with ByteSurgeon
     — but portable to other dialects

>    Let’s see an example!


© Marcus Denker
Solving the Problem



>    Operation:
     — Method Execution (around)


>    Hookset:
     — All execution operations in the wiki package

                                                      metaobject
>    Metaobject:
     — A profiling tool             links              activation
                                                      condition

                                                       hookset

© Marcus Denker
Solving the Problem: Hookset + Link


>   Hookset

      allExecs := Hookset new.
      allExecs inPackage: ’Wiki’; operation: MethodEval.


>    Link

      profile := Link id: #profiler
                      hookset: allExecs
                      metaobject: Profiler new.
      profile control: Control around.



© Marcus Denker
Solving the Problem: Protocol

>    Protocol
      profile callDescriptor:
         (CallDescriptor
            selector: #profileMethod:in:withArguments:
            parameters: {Parameter selector.
                        Parameter self.
                        Parameter arguments.}
            passingMode: PassingMode plain).


>    Install / Retract

                         profile install.
                         profile uninstall.

© Marcus Denker
Solving the Problem: Caching



>    Operation:
     — Method Execution (around)


>    Hookset:
     — The one slow method (#toughWorks:)

                                            metaobject
>    Metaobject:
     — A Cache                     links    activation
                                            condition

                                             hookset

© Marcus Denker
Caching II

    >    Hookset:
          toughWorks := Hookset new.
          toughWorks inClass: Worker; inMethod: #toughWork:;
                     operation: MethodEval.


>       Link:
                  cache := Link id: #cache
                               hookset: toughWorks
                               metaobject: Cache new.
                  cache control: Control around.

                  cache callDescriptor:(CallDescriptor
                       selector: #cacheFor:
                       parameters: {Parameter arg1}
                       passingMode: PassingMode plain).
    © Marcus Denker
Geppetto



>    Operations:
     — MethodEval (like MethodWrappers)
     — MsgSend, InstVarAccess, TempAccess



>    Control
     — Before, After, Around, Replace


>    Activation condition per Link


© Marcus Denker
Benchmarks I

>    Slowdown for reification of message send


      System                 Slowdown

      Geppetto               10.85

      Iguana/J               24

      Metaclasstalk          20




© Marcus Denker
Benchmarks II


>     Geppetto Vs. Metaclasstalk

                   Metaclasstalk   Geppetto   Speedup
                   (ms)            (ms)

       message     108             46         2.3x
       send

       instance var 272            92         2.9x
       read



© Marcus Denker
Future Work



>    Pluggable backends
     — Bytecode
     — AST based transformation
     — VM Support


>    Use for typical ByteSurgeon based projects
     — e.g. Tracing, Unstuck-Debugger


>    Experiment with advanced Scoping


© Marcus Denker
Conclusion




> Example for the need of Partial Behavioral Reflection
> Overview of Geppetto
> Solution of the Example
> Benchmarks




© Marcus Denker
Conclusion




> Example for the need of Partial Behavioral Reflection
> Overview of Geppetto
> Solution of the Example
> Benchmarks


                              Questions?

© Marcus Denker

More Related Content

Viewers also liked

Entwurf von Optimierungen für Squeak
Entwurf von Optimierungen für SqueakEntwurf von Optimierungen für Squeak
Entwurf von Optimierungen für SqueakMarcus Denker
 
Talk: The Present and Future of Pharo
Talk: The Present and Future of PharoTalk: The Present and Future of Pharo
Talk: The Present and Future of PharoMarcus Denker
 
How to Contribute to Pharo
How to Contribute to PharoHow to Contribute to Pharo
How to Contribute to PharoMarcus Denker
 
Type Feedback for Bytecode Interpreters
Type Feedback for Bytecode InterpretersType Feedback for Bytecode Interpreters
Type Feedback for Bytecode InterpretersMarcus Denker
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkMarcus Denker
 
A JIT as a System Service
A JIT as a System ServiceA JIT as a System Service
A JIT as a System ServiceMarcus Denker
 
Pharo: Objects at your Fingertips
Pharo: Objects at your FingertipsPharo: Objects at your Fingertips
Pharo: Objects at your FingertipsMarcus Denker
 
Pharo: A Reflective System
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective SystemMarcus Denker
 
Squeak als agile Entwicklungsumgebung
Squeak als agile EntwicklungsumgebungSqueak als agile Entwicklungsumgebung
Squeak als agile EntwicklungsumgebungMarcus Denker
 
Reflection and Context
Reflection and ContextReflection and Context
Reflection and ContextMarcus Denker
 
RBuilder and ByteSurgeon
RBuilder and ByteSurgeonRBuilder and ByteSurgeon
RBuilder and ByteSurgeonMarcus Denker
 
Advanced Reflection in Pharo
Advanced Reflection in PharoAdvanced Reflection in Pharo
Advanced Reflection in PharoMarcus Denker
 
What's new in Squeak 3.9
What's new in Squeak 3.9What's new in Squeak 3.9
What's new in Squeak 3.9Marcus Denker
 

Viewers also liked (17)

Entwurf von Optimierungen für Squeak
Entwurf von Optimierungen für SqueakEntwurf von Optimierungen für Squeak
Entwurf von Optimierungen für Squeak
 
Talk: The Present and Future of Pharo
Talk: The Present and Future of PharoTalk: The Present and Future of Pharo
Talk: The Present and Future of Pharo
 
Beyond VI
Beyond VIBeyond VI
Beyond VI
 
How to Contribute to Pharo
How to Contribute to PharoHow to Contribute to Pharo
How to Contribute to Pharo
 
Pharo. Next Steps.
Pharo. Next Steps.Pharo. Next Steps.
Pharo. Next Steps.
 
Type Feedback for Bytecode Interpreters
Type Feedback for Bytecode InterpretersType Feedback for Bytecode Interpreters
Type Feedback for Bytecode Interpreters
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for Smalltalk
 
A JIT as a System Service
A JIT as a System ServiceA JIT as a System Service
A JIT as a System Service
 
Pharo: Objects at your Fingertips
Pharo: Objects at your FingertipsPharo: Objects at your Fingertips
Pharo: Objects at your Fingertips
 
Pharo: A Reflective System
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective System
 
Squeak als agile Entwicklungsumgebung
Squeak als agile EntwicklungsumgebungSqueak als agile Entwicklungsumgebung
Squeak als agile Entwicklungsumgebung
 
Reflection and Context
Reflection and ContextReflection and Context
Reflection and Context
 
Lecture: Reflection
Lecture: ReflectionLecture: Reflection
Lecture: Reflection
 
RBuilder and ByteSurgeon
RBuilder and ByteSurgeonRBuilder and ByteSurgeon
RBuilder and ByteSurgeon
 
Advanced Reflection in Pharo
Advanced Reflection in PharoAdvanced Reflection in Pharo
Advanced Reflection in Pharo
 
What's new in Squeak 3.9
What's new in Squeak 3.9What's new in Squeak 3.9
What's new in Squeak 3.9
 
Squeak
SqueakSqueak
Squeak
 

Similar to Unanticipated Partial Behavioral Reflection

Unanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionUnanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionESUG
 
Sub-Method Reflection
Sub-Method ReflectionSub-Method Reflection
Sub-Method ReflectionMarcus Denker
 
Presentation about my Research
Presentation about my ResearchPresentation about my Research
Presentation about my ResearchMarcus Denker
 
Sub-method Structural and Behavioral Reflection
Sub-method Structural and Behavioral ReflectionSub-method Structural and Behavioral Reflection
Sub-method Structural and Behavioral ReflectionMarcus Denker
 
Software Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience ReportSoftware Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience ReportMarcus Denker
 
Behavioral Reflection
Behavioral ReflectionBehavioral Reflection
Behavioral ReflectionMarcus Denker
 
The meta of Meta-object Architectures
The meta of Meta-object ArchitecturesThe meta of Meta-object Architectures
The meta of Meta-object ArchitecturesMarcus Denker
 
Container orchestration from theory to practice
Container orchestration from theory to practiceContainer orchestration from theory to practice
Container orchestration from theory to practiceDocker, Inc.
 
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...Anant Corporation
 
FPC for the Masses (SANSFire Edition)
FPC for the Masses (SANSFire Edition)FPC for the Masses (SANSFire Edition)
FPC for the Masses (SANSFire Edition)Xavier Mertens
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design PatternRothana Choun
 
The Reflectivity
The ReflectivityThe Reflectivity
The ReflectivityESUG
 
Reactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnReactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnZalando Technology
 
Kubernetes 101 for Beginners
Kubernetes 101 for BeginnersKubernetes 101 for Beginners
Kubernetes 101 for BeginnersOktay Esgul
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...Frank Munz
 

Similar to Unanticipated Partial Behavioral Reflection (20)

Unanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionUnanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral Reflection
 
Reflection
ReflectionReflection
Reflection
 
Lecture: Reflection
Lecture: ReflectionLecture: Reflection
Lecture: Reflection
 
Reflectivity Demo
Reflectivity DemoReflectivity Demo
Reflectivity Demo
 
Refactoring
RefactoringRefactoring
Refactoring
 
Sub-Method Reflection
Sub-Method ReflectionSub-Method Reflection
Sub-Method Reflection
 
Presentation about my Research
Presentation about my ResearchPresentation about my Research
Presentation about my Research
 
Sub-method Structural and Behavioral Reflection
Sub-method Structural and Behavioral ReflectionSub-method Structural and Behavioral Reflection
Sub-method Structural and Behavioral Reflection
 
Software Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience ReportSoftware Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience Report
 
Behavioral Reflection
Behavioral ReflectionBehavioral Reflection
Behavioral Reflection
 
The meta of Meta-object Architectures
The meta of Meta-object ArchitecturesThe meta of Meta-object Architectures
The meta of Meta-object Architectures
 
Container orchestration from theory to practice
Container orchestration from theory to practiceContainer orchestration from theory to practice
Container orchestration from theory to practice
 
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
 
FPC for the Masses (SANSFire Edition)
FPC for the Masses (SANSFire Edition)FPC for the Masses (SANSFire Edition)
FPC for the Masses (SANSFire Edition)
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design Pattern
 
Demo: Reflectivity
Demo: ReflectivityDemo: Reflectivity
Demo: Reflectivity
 
The Reflectivity
The ReflectivityThe Reflectivity
The Reflectivity
 
Reactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnReactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
 
Kubernetes 101 for Beginners
Kubernetes 101 for BeginnersKubernetes 101 for Beginners
Kubernetes 101 for Beginners
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
 

More from Marcus Denker

ConstantBlocks in Pharo11
ConstantBlocks in Pharo11ConstantBlocks in Pharo11
ConstantBlocks in Pharo11Marcus Denker
 
First Class Variables as AST Annotations
First Class Variables as AST AnnotationsFirst Class Variables as AST Annotations
First Class Variables as AST AnnotationsMarcus Denker
 
Supporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo SupportSupporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo SupportMarcus Denker
 
Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Marcus Denker
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerMarcus Denker
 
Lecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksLecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksMarcus Denker
 
Improving code completion for Pharo
Improving code completion for PharoImproving code completion for Pharo
Improving code completion for PharoMarcus Denker
 
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinksVUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinksMarcus Denker
 
Lecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksLecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksMarcus Denker
 
Open-Source: An Infinite Game
Open-Source: An Infinite GameOpen-Source: An Infinite Game
Open-Source: An Infinite GameMarcus Denker
 
PharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to PharoPharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to PharoMarcus Denker
 
Feedback Loops in Practice
Feedback Loops in PracticeFeedback Loops in Practice
Feedback Loops in PracticeMarcus Denker
 

More from Marcus Denker (20)

Soil And Pharo
Soil And PharoSoil And Pharo
Soil And Pharo
 
ConstantBlocks in Pharo11
ConstantBlocks in Pharo11ConstantBlocks in Pharo11
ConstantBlocks in Pharo11
 
Demo: Improved DoIt
Demo: Improved DoItDemo: Improved DoIt
Demo: Improved DoIt
 
First Class Variables as AST Annotations
First Class Variables as AST AnnotationsFirst Class Variables as AST Annotations
First Class Variables as AST Annotations
 
Supporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo SupportSupporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo Support
 
Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Variables in Pharo
Variables in PharoVariables in Pharo
Variables in Pharo
 
Lecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksLecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinks
 
Improving code completion for Pharo
Improving code completion for PharoImproving code completion for Pharo
Improving code completion for Pharo
 
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinksVUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
 
Slot Composition
Slot CompositionSlot Composition
Slot Composition
 
Lecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksLecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinks
 
PHARO IOT
PHARO IOTPHARO IOT
PHARO IOT
 
Open-Source: An Infinite Game
Open-Source: An Infinite GameOpen-Source: An Infinite Game
Open-Source: An Infinite Game
 
Lecture: MetaLinks
Lecture: MetaLinksLecture: MetaLinks
Lecture: MetaLinks
 
PharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to PharoPharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to Pharo
 
Feedback Loops in Practice
Feedback Loops in PracticeFeedback Loops in Practice
Feedback Loops in Practice
 
Pharo6 - ESUG17
Pharo6 - ESUG17Pharo6 - ESUG17
Pharo6 - ESUG17
 
Pharo6
Pharo6Pharo6
Pharo6
 

Recently uploaded

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Recently uploaded (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

Unanticipated Partial Behavioral Reflection

  • 1. Unanticipated Partial Behavioral Reflection David Röthlisberger Marcus Denker Eric Tanter © Marcus Denker
  • 2. Roadmap > Example > Behavioral Reflection — Smalltalk / Metaclasstalk — Unanticipated Reflection — Partial Reflection > Unanticipated Partial Behavioral Reflection > Example revisited > Benchmarks > Conclusion © Marcus Denker
  • 3. Running Example > Typical web application (e.g. Wiki) > Shows performance problem under high load > Goals: — Profile and fix the problem — No restart / interruption of service © Marcus Denker
  • 4. Towards a Solution > Analyse the problem — Install profiler — Analyze — Retract profiler > Solve the problem — Introduce a caching mechanism — Experiment with multiple solutions © Marcus Denker
  • 5. Reflection > Reflection: computation about computation — base level / meta level — causally connected > Structural Reflection — Reification of structure > Behavioral Reflection — Reification of execution © Marcus Denker
  • 6. Unanticipated Reflection > “Unanticipated Use” means: — No need to know in advance (and plan for) reflection — Possible to be done at runtime > Java: reflection only at load time — No runtime change in general — Need to compile in hooks for reflection > Smalltalk reflection is unanticipated — taken for granted. But it’s quite cool! © Marcus Denker
  • 7. Reflection in Smalltalk > Structural Reflection — Classes / Methods are objects — Can be changed at runtime > Behavioral Reflection — No model of execution below method body — message sending / variable access hard coded by VM — #doesNotUnderstand / MethodWrappers > Reflective capabilities of Smalltalk should be improved! © Marcus Denker
  • 8. MetaclassTalk > Extends the Smalltalk metaclass model > Metaclass defines — message lookup — access to instance variables > Problems: — Reflection only controllable at class boundaries — No fine-grained selection (e.g. single operations) — Protocol between base and meta level is fixed © Marcus Denker
  • 9. Partial Reflection > Hooksets: collection of operation occurrences > Links — Bind hooksets to metaobjects — Define Protocol between base and meta metaobject > Goals — Highly selective reification links activation condition — Flexiblel metalevel engineering – Protocol specification hookset – Cross-cutting hooksets © Marcus Denker
  • 10. Geppetto > Partial Behavioral Reflection pioneered in Java — Code transformation at load time — Not unanticipated (it’s Java...) > Geppetto: Partial Behavioral Reflection for Smalltalk > For Squeak 3.9 with ByteSurgeon — but portable to other dialects > Let’s see an example! © Marcus Denker
  • 11. Solving the Problem > Operation: — Method Execution (around) > Hookset: — All execution operations in the wiki package metaobject > Metaobject: — A profiling tool links activation condition hookset © Marcus Denker
  • 12. Solving the Problem: Hookset + Link > Hookset allExecs := Hookset new. allExecs inPackage: ’Wiki’; operation: MethodEval. > Link profile := Link id: #profiler hookset: allExecs metaobject: Profiler new. profile control: Control around. © Marcus Denker
  • 13. Solving the Problem: Protocol > Protocol profile callDescriptor: (CallDescriptor selector: #profileMethod:in:withArguments: parameters: {Parameter selector. Parameter self. Parameter arguments.} passingMode: PassingMode plain). > Install / Retract profile install. profile uninstall. © Marcus Denker
  • 14. Solving the Problem: Caching > Operation: — Method Execution (around) > Hookset: — The one slow method (#toughWorks:) metaobject > Metaobject: — A Cache links activation condition hookset © Marcus Denker
  • 15. Caching II > Hookset: toughWorks := Hookset new. toughWorks inClass: Worker; inMethod: #toughWork:; operation: MethodEval. > Link: cache := Link id: #cache hookset: toughWorks metaobject: Cache new. cache control: Control around. cache callDescriptor:(CallDescriptor selector: #cacheFor: parameters: {Parameter arg1} passingMode: PassingMode plain). © Marcus Denker
  • 16. Geppetto > Operations: — MethodEval (like MethodWrappers) — MsgSend, InstVarAccess, TempAccess > Control — Before, After, Around, Replace > Activation condition per Link © Marcus Denker
  • 17. Benchmarks I > Slowdown for reification of message send System Slowdown Geppetto 10.85 Iguana/J 24 Metaclasstalk 20 © Marcus Denker
  • 18. Benchmarks II > Geppetto Vs. Metaclasstalk Metaclasstalk Geppetto Speedup (ms) (ms) message 108 46 2.3x send instance var 272 92 2.9x read © Marcus Denker
  • 19. Future Work > Pluggable backends — Bytecode — AST based transformation — VM Support > Use for typical ByteSurgeon based projects — e.g. Tracing, Unstuck-Debugger > Experiment with advanced Scoping © Marcus Denker
  • 20. Conclusion > Example for the need of Partial Behavioral Reflection > Overview of Geppetto > Solution of the Example > Benchmarks © Marcus Denker
  • 21. Conclusion > Example for the need of Partial Behavioral Reflection > Overview of Geppetto > Solution of the Example > Benchmarks Questions? © Marcus Denker