SlideShare una empresa de Scribd logo
1 de 56
Descargar para leer sin conexión
An Aspect-Oriented Approach
          to Productivity Improvement
            for a Dynamic Language
             using Typing Concerns

                      Chanwit Kaewkasi
                  School of Computer Science
                  The University of Manchester
Supervisor: John R. Gurd
Advisor:    Chris Kirkham
Motivation
●   The High Productivity Computer Systems
    (HPCS) program
●   Productivity
●   Aspect-oriented programming (AOP)
●   Groovy




                      C. Kaewkasi            2
Motivation – HPCS
●   The High Productivity Computer Systems
    (HPCS) program.
●   A program seeking for systems (languages +
    platforms) that can double their productivity for
    every 18 months.
●   Focuses on both
    ●   The development time, and
    ●   The execution time.


                              C. Kaewkasi               3
Motivation – Productivity
●   If compilation time is not concerned:

●   If compilation time is concerned:

T(P) is the total time for solving problem P
     with a certain programming language.
I(P) is the average development time.
C(P) is the average compilation time.
E(P) is the average execution time.

                                 C. Kaewkasi   4
Motivation – Productivity
●   Relative productivity between the base
    language 0 and the new language L.
    ●   P0 , problem P written in language 0.
    ●   PL, problem P written in language L.




                                C. Kaewkasi     5
Motivation – AOP
●   A programming paradigm
●   Coping with crosscutting concerns
●   Four major models:
    ●   Pointcut-advice
    ●   Inter-type declaration
    ●   Class composition
    ●   Traversal



                             C. Kaewkasi   6
Motivation – AOP (cont'd)
●   Join point
    ●   An abstract point in the flow of the execution of a
        program.
●   Aspect
    ●   A modular unit encapsulating crosscutting concerns.
●   Pointcut
    ●   An expression for selecting, i.e. quantifying, join points.
●   Advice codes
    ●   A place (e.g., before, after, around) with
        actions to perform at a certain join point.
                               C. Kaewkasi                            7
Motivation – AOP (cont'd)
●   Properties
    ●   Quantification; a language has a feature for
        selecting a set of join points with, e.g., an
        expression.
    ●   Invasiveness; this property allows execution of
        aspect codes at a join point of the base program
        without explicit declaration of that point.




                             C. Kaewkasi                   8
Motivation – Groovy
●   A dynamically typed language
    ●   Type is optional
●   Runs on Java Virtual Machines
●   A direct migration path for Java
    ●   Resembles the Java's syntax.
    ●   Use the same environment, package system and run-
        time.
●   Use call site caching to improve performance
    ●   A key place for typing concerns.
    ●   Each call site corresponds to a call join point.
                               C. Kaewkasi                  9
Hypothesis

  Overall productivity of a computer program
 written in a dynamic language, in terms of the
development time, the compilation time and the
 execution time, can be improved by applying
 a dynamic aspect-oriented typing technique.




                     C. Kaewkasi                  10
Thesis questions
●   What is the appropriate aspect-oriented technique?
    ●   Ans: Type advice (for Typing concerns)
●   How is the aspect-oriented technique used for
    improving performance?
    ●   Ans: Quantifying call join points, advising type to them.
        When type of these points are obvious, traditional
        optimisation can be applied.
●   How to determine that the technique does improve
    overall productivity?
    ●   Ans: Relative productivity metric.

                              C. Kaewkasi                           11
Typing concerns
●   A kind of concerns found in dynamic languages
    ●   To be precise, dynamically typed languages.
●   Type-related
●   Why only dynamic languages?
    ●   Because type is not mandatory in this family of
        languages.
    ●   Type is strongly embodied as a part of statically
        typed languages.
        –   Their compilers just won't allow us to separate typing.

                                 C. Kaewkasi                          12
Life cycle of a join point




          C. Kaewkasi        13
Life cycle of a join point




          C. Kaewkasi        14
Join point model of typing concerns
●   Join point definition
    ●   Traditional + the join point formation phase
●   Identification of join point
    ●   Pointcut-advice
        def pointcut = pcall('T.x') & args(i)
●   Specifying actions
    ●   Type advice
        typing(pointcut) { i >> int }

                             C. Kaewkasi               15
Join point model of typing concerns
●   Join point definition
    ●   Traditional + the join point formation phase
●   Identification of join point
    ●   Pointcut-advice
        def pointcut = pcall('T.x') & args(i)
●   Specifying actions
    ●   Type advice
        typing(pointcut) { i >> int }

                             C. Kaewkasi               16
Properties
●   Quantification
    ●   Inherited from the pointcut-advice model.
●   Invasiveness
    ●   Performance improvement is transparent to the
        base programs.




                            C. Kaewkasi                 17
FGV calculus
●   A core object-oriented calculus based on
    Featherweight Java.
●   Objectives
    ●   To study call site behaviours.
        –   Modelled invocation through call site objects.
        –   Leads to invention of type advice, and typing concerns.
    ●   To present a proof of performance improvement.
        –   A dynamic call can be always replaced by a type advised
            call, which is faster.


                                C. Kaewkasi                           18
Reduction rules of FGV




         C. Kaewkasi     19
Reduction rules of FGV (cont'd)




             C. Kaewkasi          20
FGV program




    C. Kaewkasi   21
Computation example




       C. Kaewkasi    22
Theorem
Type advised call theorem:
  A dynamic call (new C(e)).m(d) can be replaced
  by a typed advised call C'.m'(new C(e), d) with a
  smaller steps of reduction, for some class C and some
  type advised class C'.




                        C. Kaewkasi                   23
Theorem
Type advised call theorem:
    A dynamic call (new C(e)).m(d) can be replaced
    by a typed advised call C'.m'(new C(e), d) with a
    smaller steps of reduction, for some class C and some
    type advised class C'.

A dynamic call dispatched
through its call site object.
                                               A class-level call dispatched directly.


                   In the implementation,
                   this class is run-time generated.
                                      C. Kaewkasi                                    24
Reduction steps – Why faster?
●   Dynamic call
    (when the type advised class does not exist)
    ●   R-Call → R-Invk → R-Field → R-Exec
●   Dynamic call via call site replacement
    (when the typed advised class exists)
    ●   R-Call → R-Invk → R-Field → R-Repl
●   Type advised call
    ●   R-Sinvk

                          C. Kaewkasi              25
Reduction steps – Why faster?
●   Dynamic call
    (when the type advised class does not exist)
    ●   R-Call → R-Invk → R-Field → R-Exec
●   Dynamic call via call site replacement
    (when the typed advised class exists)
    ●   R-Call → R-Invk → R-Field → R-Repl
●   Type advised call                   Replaceable
    ●   R-Sinvk

                          C. Kaewkasi                 26
Groovy AOP
●   Pointcut-advice implementation
    ●   Join point
    ●   Aspect
    ●   Pointcut
    ●   Advice (before, after, and around)
●   Type advice implementation
    ●   Advice (typing)



                          C. Kaewkasi        27
Type Advice Engine
●   Using Groovy AOP for matching join points
●   If matched
    ●   Generate a type advised class for the current
        matched join point.
    ●   Optimise the generated type advised class.
    ●   Replace the current call join point, i.e. the current
        call site, with the type advised call.
    ●   Load the type advised class into the class loader.
    ●   Re-define the current class via JVMTI.
●   Wait and the program will be faster.
                              C. Kaewkasi                       28
Relative productivity
●   Compare between Java and Groovy with typing
    concerns (GT).




                      C. Kaewkasi             29
Relative productivity (cont'd)
●   Relative power is assumed to be 1 because
    ●   The syntax of Groovy resembles that of Java.
    ●   Its development environment, package, run-time
        systems are the same.


    ●   Only relative compilation and relative efficiency are
        measured.




                             C. Kaewkasi                        30
Benchmarks
●   Fibonacci
●   Heap sort
●   Sieve (prime number computation)
●   Fannkuch (pancake flipping)
●   Running on
    ●   Core2 Duo 3.0 GHz, Linux 2.6, JDK 1.6.0_b14
    ●   P4 2.6 GHz, Windows 2000, JDK 1.6.0_b16
    ●   Both running client and server JVM configurations
                            C. Kaewkasi                     31
Compilation time measurement
●   For Java
    ●   Timing around com.sun.tools.javac.Main
    ●   Benchmarks only.
●   For Groovy with typing concerns
    ●   Timing around Groovy's interactive tool
    ●   Benchmarks and their typing aspects.




                            C. Kaewkasi           32
Compilation times in Milliseconds




              C. Kaewkasi           33
Execution time measurement
●   Both for Java and Groovy with typing concerns
    ●   Run each benchmarks
    ●   Measurement are divided into two parts, start-up
        time and steady state.




                            C. Kaewkasi                    34
Fibonacci – Core2 machine




          C. Kaewkasi       35
Fibonacci – Core2 machine




          C. Kaewkasi       36
Fibonacci – P4 machine




         C. Kaewkasi     37
Fibonacci – P4 machine




         C. Kaewkasi     38
Heap sort – Core2 machine




          C. Kaewkasi       39
Heap sort – Core2 machine




          C. Kaewkasi       40
Heap sort – P4 machine




         C. Kaewkasi     41
Heap sort – P4 machine




         C. Kaewkasi     42
Sieve – Core2 machine




        C. Kaewkasi     43
Sieve – Core2 machine




        C. Kaewkasi     44
Sieve – P4 machine




       C. Kaewkasi   45
Sieve – P4 machine




       C. Kaewkasi   46
Fannkuch – Core2 machine




          C. Kaewkasi      47
Fannkuch – Core2 machine




          C. Kaewkasi      48
Fannkuch – P4 machine




        C. Kaewkasi     49
Fannkuch – P4 machine




        C. Kaewkasi     50
Results




 C. Kaewkasi   51
Results




 C. Kaewkasi   52
Conclusion
●   This thesis has introduced a new kind of type-
    related aspect techniques, typing concerns.
●   A technique of advising type information to a
    certain join point is called type advice.
●   This technique has been demonstrated to
    improve performance of a dynamic language,
    Groovy. While the technique still preserves its
    productivity.


                        C. Kaewkasi                   53
Other contributions
●   Type Advice Engine
    ●   A bytecode transformation module for advising type.
●   Groovy AOP
    ●   A dynamic AOP implementation.
●   FGV calculus
    ●   A core calculus language for studying call site
        behaviour.
●   The term relative compilation to relative
    productivity metrics
                             C. Kaewkasi                  54
Future work
●   Generalisation of typing concerns to statically
    typed languages?
●   Implementation of Type Advice Engine:
    ●   into virtual machines.
    ●   near the level of virtual machines.
●   Combination of typing and parallelisation
    concerns?
●   Further study of appropriate relative productivity
    metrics for virtual machines.
                             C. Kaewkasi              55
Thank you
●   Please feel free to ask questions.




                        C. Kaewkasi      56

Más contenido relacionado

Destacado

Nigel Maris & Tom Screen, Assembled Electronics Solutions Ltd
Nigel Maris & Tom Screen, Assembled Electronics Solutions LtdNigel Maris & Tom Screen, Assembled Electronics Solutions Ltd
Nigel Maris & Tom Screen, Assembled Electronics Solutions LtdWMG, University of Warwick
 
Ejercicios de algoritmos
Ejercicios de algoritmosEjercicios de algoritmos
Ejercicios de algoritmossergio ramos
 
1. introduction to financial management
1. introduction to financial management1. introduction to financial management
1. introduction to financial managementZubair Inam Barbhuiya
 
EL AYUNTAMIENTO APOYARÁ LA ADOPCIÓN TOTALMENTE GRATUITA DE PERROS DEL ZOOSANI...
EL AYUNTAMIENTO APOYARÁ LA ADOPCIÓN TOTALMENTE GRATUITA DE PERROS DEL ZOOSANI...EL AYUNTAMIENTO APOYARÁ LA ADOPCIÓN TOTALMENTE GRATUITA DE PERROS DEL ZOOSANI...
EL AYUNTAMIENTO APOYARÁ LA ADOPCIÓN TOTALMENTE GRATUITA DE PERROS DEL ZOOSANI...Ayuntamiento de Málaga
 
ბიზნეს ეთიკა
ბიზნეს ეთიკაბიზნეს ეთიკა
ბიზნეს ეთიკაDavid Jafaridze
 
Culture et recherche : les publics in-situ et en ligne
Culture et recherche : les publics in-situ et en ligneCulture et recherche : les publics in-situ et en ligne
Culture et recherche : les publics in-situ et en ligneLa French Team
 
[창업에듀]26. 창업자역량 리더십 환경 변화에 따른 조직원의 책임
[창업에듀]26. 창업자역량 리더십 환경 변화에 따른 조직원의 책임[창업에듀]26. 창업자역량 리더십 환경 변화에 따른 조직원의 책임
[창업에듀]26. 창업자역량 리더십 환경 변화에 따른 조직원의 책임쪼 꼬
 
Productivity measurement approaches
Productivity measurement approachesProductivity measurement approaches
Productivity measurement approachesAmit Verma
 
Χριστουγεννιάτικο Bazaar 2016 - 2017
Χριστουγεννιάτικο Bazaar 2016 - 2017Χριστουγεννιάτικο Bazaar 2016 - 2017
Χριστουγεννιάτικο Bazaar 2016 - 2017viv_h
 
Human aspect of project management
Human aspect of project managementHuman aspect of project management
Human aspect of project managementKinshook Chaturvedi
 
Construction productivity
Construction productivityConstruction productivity
Construction productivitySunil Manjeri
 
Chapter 2 strategic human resource planning
Chapter 2 strategic human resource planningChapter 2 strategic human resource planning
Chapter 2 strategic human resource planningLo-Ann Placido
 
EL AYUNTAMIENTO MANTIENE Y REFUERZA EL PLAN ESPECIAL DE LUCHA CONTRA LA POBREZA
EL AYUNTAMIENTO MANTIENE Y REFUERZA EL PLAN ESPECIAL DE LUCHA CONTRA LA POBREZAEL AYUNTAMIENTO MANTIENE Y REFUERZA EL PLAN ESPECIAL DE LUCHA CONTRA LA POBREZA
EL AYUNTAMIENTO MANTIENE Y REFUERZA EL PLAN ESPECIAL DE LUCHA CONTRA LA POBREZAAyuntamiento de Málaga
 
Presentation romuald cetkovic
Presentation romuald cetkovicPresentation romuald cetkovic
Presentation romuald cetkovicVladimir Takmanov
 
Strategic human resource planning ppt
Strategic human resource planning pptStrategic human resource planning ppt
Strategic human resource planning pptPankaj kumar
 
Case Study and Research on System Dynamics in Hotel Management
Case Study and Research on System Dynamics in Hotel ManagementCase Study and Research on System Dynamics in Hotel Management
Case Study and Research on System Dynamics in Hotel ManagementFaizan Ali
 

Destacado (20)

094 Productivity Measurement
094 Productivity Measurement094 Productivity Measurement
094 Productivity Measurement
 
Nigel Maris & Tom Screen, Assembled Electronics Solutions Ltd
Nigel Maris & Tom Screen, Assembled Electronics Solutions LtdNigel Maris & Tom Screen, Assembled Electronics Solutions Ltd
Nigel Maris & Tom Screen, Assembled Electronics Solutions Ltd
 
Ejercicios de algoritmos
Ejercicios de algoritmosEjercicios de algoritmos
Ejercicios de algoritmos
 
1. introduction to financial management
1. introduction to financial management1. introduction to financial management
1. introduction to financial management
 
EL AYUNTAMIENTO APOYARÁ LA ADOPCIÓN TOTALMENTE GRATUITA DE PERROS DEL ZOOSANI...
EL AYUNTAMIENTO APOYARÁ LA ADOPCIÓN TOTALMENTE GRATUITA DE PERROS DEL ZOOSANI...EL AYUNTAMIENTO APOYARÁ LA ADOPCIÓN TOTALMENTE GRATUITA DE PERROS DEL ZOOSANI...
EL AYUNTAMIENTO APOYARÁ LA ADOPCIÓN TOTALMENTE GRATUITA DE PERROS DEL ZOOSANI...
 
ბიზნეს ეთიკა
ბიზნეს ეთიკაბიზნეს ეთიკა
ბიზნეს ეთიკა
 
Culture et recherche : les publics in-situ et en ligne
Culture et recherche : les publics in-situ et en ligneCulture et recherche : les publics in-situ et en ligne
Culture et recherche : les publics in-situ et en ligne
 
Lista
ListaLista
Lista
 
[창업에듀]26. 창업자역량 리더십 환경 변화에 따른 조직원의 책임
[창업에듀]26. 창업자역량 리더십 환경 변화에 따른 조직원의 책임[창업에듀]26. 창업자역량 리더십 환경 변화에 따른 조직원의 책임
[창업에듀]26. 창업자역량 리더십 환경 변화에 따른 조직원의 책임
 
Productivity measurement approaches
Productivity measurement approachesProductivity measurement approaches
Productivity measurement approaches
 
Χριστουγεννιάτικο Bazaar 2016 - 2017
Χριστουγεννιάτικο Bazaar 2016 - 2017Χριστουγεννιάτικο Bazaar 2016 - 2017
Χριστουγεννιάτικο Bazaar 2016 - 2017
 
Human aspect of project management
Human aspect of project managementHuman aspect of project management
Human aspect of project management
 
Production
ProductionProduction
Production
 
Construction productivity
Construction productivityConstruction productivity
Construction productivity
 
Chapter 2 strategic human resource planning
Chapter 2 strategic human resource planningChapter 2 strategic human resource planning
Chapter 2 strategic human resource planning
 
EL AYUNTAMIENTO MANTIENE Y REFUERZA EL PLAN ESPECIAL DE LUCHA CONTRA LA POBREZA
EL AYUNTAMIENTO MANTIENE Y REFUERZA EL PLAN ESPECIAL DE LUCHA CONTRA LA POBREZAEL AYUNTAMIENTO MANTIENE Y REFUERZA EL PLAN ESPECIAL DE LUCHA CONTRA LA POBREZA
EL AYUNTAMIENTO MANTIENE Y REFUERZA EL PLAN ESPECIAL DE LUCHA CONTRA LA POBREZA
 
Presentation romuald cetkovic
Presentation romuald cetkovicPresentation romuald cetkovic
Presentation romuald cetkovic
 
Strategic human resource planning ppt
Strategic human resource planning pptStrategic human resource planning ppt
Strategic human resource planning ppt
 
Case Study and Research on System Dynamics in Hotel Management
Case Study and Research on System Dynamics in Hotel ManagementCase Study and Research on System Dynamics in Hotel Management
Case Study and Research on System Dynamics in Hotel Management
 
Academia general
Academia generalAcademia general
Academia general
 

Similar a Typing Concerns

Delivery Pipelines as a First Class Citizen @deliverAgile2019
Delivery Pipelines as a First Class Citizen @deliverAgile2019Delivery Pipelines as a First Class Citizen @deliverAgile2019
Delivery Pipelines as a First Class Citizen @deliverAgile2019ciberkleid
 
Deterministic Galois: On-demand, Portable and Parameterless
Deterministic Galois: On-demand, Portable and ParameterlessDeterministic Galois: On-demand, Portable and Parameterless
Deterministic Galois: On-demand, Portable and ParameterlessDonald Nguyen
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplateStanislav Petrov
 
Towards quantum machine learning calogero zarbo - meet up
Towards quantum machine learning  calogero zarbo - meet upTowards quantum machine learning  calogero zarbo - meet up
Towards quantum machine learning calogero zarbo - meet upDeep Learning Italia
 
Project management frameworks for software developing
Project management frameworks for software developingProject management frameworks for software developing
Project management frameworks for software developingVicente Bolea
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsWeaveworks
 
Superworkflow of Graph Neural Networks with K8S and Fugue
Superworkflow of Graph Neural Networks with K8S and FugueSuperworkflow of Graph Neural Networks with K8S and Fugue
Superworkflow of Graph Neural Networks with K8S and FugueDatabricks
 
Free GitOps Workshop
Free GitOps WorkshopFree GitOps Workshop
Free GitOps WorkshopWeaveworks
 
AOT-compilation of JavaScript with V8
AOT-compilation of JavaScript with V8AOT-compilation of JavaScript with V8
AOT-compilation of JavaScript with V8Phil Eaton
 
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNetFrom Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNetEric Haibin Lin
 
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"Fwdays
 
Exploring the Real Power of Functional Programming
Exploring the Real Power of Functional ProgrammingExploring the Real Power of Functional Programming
Exploring the Real Power of Functional ProgrammingKnoldus Inc.
 
Certification Study Group - Professional ML Engineer Session 3 (Machine Learn...
Certification Study Group - Professional ML Engineer Session 3 (Machine Learn...Certification Study Group - Professional ML Engineer Session 3 (Machine Learn...
Certification Study Group - Professional ML Engineer Session 3 (Machine Learn...gdgsurrey
 
CSEG1001Unit 2 C Programming Fundamentals
CSEG1001Unit 2 C Programming FundamentalsCSEG1001Unit 2 C Programming Fundamentals
CSEG1001Unit 2 C Programming FundamentalsDhiviya Rose
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Languageelliando dias
 
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech UpdateAdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Updatejamieayre
 

Similar a Typing Concerns (20)

Delivery Pipelines as a First Class Citizen @deliverAgile2019
Delivery Pipelines as a First Class Citizen @deliverAgile2019Delivery Pipelines as a First Class Citizen @deliverAgile2019
Delivery Pipelines as a First Class Citizen @deliverAgile2019
 
Deterministic Galois: On-demand, Portable and Parameterless
Deterministic Galois: On-demand, Portable and ParameterlessDeterministic Galois: On-demand, Portable and Parameterless
Deterministic Galois: On-demand, Portable and Parameterless
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
 
Nexmark with beam
Nexmark with beamNexmark with beam
Nexmark with beam
 
Towards quantum machine learning calogero zarbo - meet up
Towards quantum machine learning  calogero zarbo - meet upTowards quantum machine learning  calogero zarbo - meet up
Towards quantum machine learning calogero zarbo - meet up
 
2014/07/17 Parallelize computer vision by GPGPU computing
2014/07/17 Parallelize computer vision by GPGPU computing2014/07/17 Parallelize computer vision by GPGPU computing
2014/07/17 Parallelize computer vision by GPGPU computing
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
Project management frameworks for software developing
Project management frameworks for software developingProject management frameworks for software developing
Project management frameworks for software developing
 
Lesson 1 introduction to programming
Lesson 1 introduction to programmingLesson 1 introduction to programming
Lesson 1 introduction to programming
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOps
 
Superworkflow of Graph Neural Networks with K8S and Fugue
Superworkflow of Graph Neural Networks with K8S and FugueSuperworkflow of Graph Neural Networks with K8S and Fugue
Superworkflow of Graph Neural Networks with K8S and Fugue
 
Free GitOps Workshop
Free GitOps WorkshopFree GitOps Workshop
Free GitOps Workshop
 
AOT-compilation of JavaScript with V8
AOT-compilation of JavaScript with V8AOT-compilation of JavaScript with V8
AOT-compilation of JavaScript with V8
 
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNetFrom Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
 
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
Oleksii Moskalenko "Continuous Delivery of ML Pipelines to Production"
 
Exploring the Real Power of Functional Programming
Exploring the Real Power of Functional ProgrammingExploring the Real Power of Functional Programming
Exploring the Real Power of Functional Programming
 
Certification Study Group - Professional ML Engineer Session 3 (Machine Learn...
Certification Study Group - Professional ML Engineer Session 3 (Machine Learn...Certification Study Group - Professional ML Engineer Session 3 (Machine Learn...
Certification Study Group - Professional ML Engineer Session 3 (Machine Learn...
 
CSEG1001Unit 2 C Programming Fundamentals
CSEG1001Unit 2 C Programming FundamentalsCSEG1001Unit 2 C Programming Fundamentals
CSEG1001Unit 2 C Programming Fundamentals
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Language
 
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech UpdateAdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Typing Concerns

  • 1. An Aspect-Oriented Approach to Productivity Improvement for a Dynamic Language using Typing Concerns Chanwit Kaewkasi School of Computer Science The University of Manchester Supervisor: John R. Gurd Advisor: Chris Kirkham
  • 2. Motivation ● The High Productivity Computer Systems (HPCS) program ● Productivity ● Aspect-oriented programming (AOP) ● Groovy C. Kaewkasi 2
  • 3. Motivation – HPCS ● The High Productivity Computer Systems (HPCS) program. ● A program seeking for systems (languages + platforms) that can double their productivity for every 18 months. ● Focuses on both ● The development time, and ● The execution time. C. Kaewkasi 3
  • 4. Motivation – Productivity ● If compilation time is not concerned: ● If compilation time is concerned: T(P) is the total time for solving problem P with a certain programming language. I(P) is the average development time. C(P) is the average compilation time. E(P) is the average execution time. C. Kaewkasi 4
  • 5. Motivation – Productivity ● Relative productivity between the base language 0 and the new language L. ● P0 , problem P written in language 0. ● PL, problem P written in language L. C. Kaewkasi 5
  • 6. Motivation – AOP ● A programming paradigm ● Coping with crosscutting concerns ● Four major models: ● Pointcut-advice ● Inter-type declaration ● Class composition ● Traversal C. Kaewkasi 6
  • 7. Motivation – AOP (cont'd) ● Join point ● An abstract point in the flow of the execution of a program. ● Aspect ● A modular unit encapsulating crosscutting concerns. ● Pointcut ● An expression for selecting, i.e. quantifying, join points. ● Advice codes ● A place (e.g., before, after, around) with actions to perform at a certain join point. C. Kaewkasi 7
  • 8. Motivation – AOP (cont'd) ● Properties ● Quantification; a language has a feature for selecting a set of join points with, e.g., an expression. ● Invasiveness; this property allows execution of aspect codes at a join point of the base program without explicit declaration of that point. C. Kaewkasi 8
  • 9. Motivation – Groovy ● A dynamically typed language ● Type is optional ● Runs on Java Virtual Machines ● A direct migration path for Java ● Resembles the Java's syntax. ● Use the same environment, package system and run- time. ● Use call site caching to improve performance ● A key place for typing concerns. ● Each call site corresponds to a call join point. C. Kaewkasi 9
  • 10. Hypothesis Overall productivity of a computer program written in a dynamic language, in terms of the development time, the compilation time and the execution time, can be improved by applying a dynamic aspect-oriented typing technique. C. Kaewkasi 10
  • 11. Thesis questions ● What is the appropriate aspect-oriented technique? ● Ans: Type advice (for Typing concerns) ● How is the aspect-oriented technique used for improving performance? ● Ans: Quantifying call join points, advising type to them. When type of these points are obvious, traditional optimisation can be applied. ● How to determine that the technique does improve overall productivity? ● Ans: Relative productivity metric. C. Kaewkasi 11
  • 12. Typing concerns ● A kind of concerns found in dynamic languages ● To be precise, dynamically typed languages. ● Type-related ● Why only dynamic languages? ● Because type is not mandatory in this family of languages. ● Type is strongly embodied as a part of statically typed languages. – Their compilers just won't allow us to separate typing. C. Kaewkasi 12
  • 13. Life cycle of a join point C. Kaewkasi 13
  • 14. Life cycle of a join point C. Kaewkasi 14
  • 15. Join point model of typing concerns ● Join point definition ● Traditional + the join point formation phase ● Identification of join point ● Pointcut-advice def pointcut = pcall('T.x') & args(i) ● Specifying actions ● Type advice typing(pointcut) { i >> int } C. Kaewkasi 15
  • 16. Join point model of typing concerns ● Join point definition ● Traditional + the join point formation phase ● Identification of join point ● Pointcut-advice def pointcut = pcall('T.x') & args(i) ● Specifying actions ● Type advice typing(pointcut) { i >> int } C. Kaewkasi 16
  • 17. Properties ● Quantification ● Inherited from the pointcut-advice model. ● Invasiveness ● Performance improvement is transparent to the base programs. C. Kaewkasi 17
  • 18. FGV calculus ● A core object-oriented calculus based on Featherweight Java. ● Objectives ● To study call site behaviours. – Modelled invocation through call site objects. – Leads to invention of type advice, and typing concerns. ● To present a proof of performance improvement. – A dynamic call can be always replaced by a type advised call, which is faster. C. Kaewkasi 18
  • 19. Reduction rules of FGV C. Kaewkasi 19
  • 20. Reduction rules of FGV (cont'd) C. Kaewkasi 20
  • 21. FGV program C. Kaewkasi 21
  • 22. Computation example C. Kaewkasi 22
  • 23. Theorem Type advised call theorem: A dynamic call (new C(e)).m(d) can be replaced by a typed advised call C'.m'(new C(e), d) with a smaller steps of reduction, for some class C and some type advised class C'. C. Kaewkasi 23
  • 24. Theorem Type advised call theorem: A dynamic call (new C(e)).m(d) can be replaced by a typed advised call C'.m'(new C(e), d) with a smaller steps of reduction, for some class C and some type advised class C'. A dynamic call dispatched through its call site object. A class-level call dispatched directly. In the implementation, this class is run-time generated. C. Kaewkasi 24
  • 25. Reduction steps – Why faster? ● Dynamic call (when the type advised class does not exist) ● R-Call → R-Invk → R-Field → R-Exec ● Dynamic call via call site replacement (when the typed advised class exists) ● R-Call → R-Invk → R-Field → R-Repl ● Type advised call ● R-Sinvk C. Kaewkasi 25
  • 26. Reduction steps – Why faster? ● Dynamic call (when the type advised class does not exist) ● R-Call → R-Invk → R-Field → R-Exec ● Dynamic call via call site replacement (when the typed advised class exists) ● R-Call → R-Invk → R-Field → R-Repl ● Type advised call Replaceable ● R-Sinvk C. Kaewkasi 26
  • 27. Groovy AOP ● Pointcut-advice implementation ● Join point ● Aspect ● Pointcut ● Advice (before, after, and around) ● Type advice implementation ● Advice (typing) C. Kaewkasi 27
  • 28. Type Advice Engine ● Using Groovy AOP for matching join points ● If matched ● Generate a type advised class for the current matched join point. ● Optimise the generated type advised class. ● Replace the current call join point, i.e. the current call site, with the type advised call. ● Load the type advised class into the class loader. ● Re-define the current class via JVMTI. ● Wait and the program will be faster. C. Kaewkasi 28
  • 29. Relative productivity ● Compare between Java and Groovy with typing concerns (GT). C. Kaewkasi 29
  • 30. Relative productivity (cont'd) ● Relative power is assumed to be 1 because ● The syntax of Groovy resembles that of Java. ● Its development environment, package, run-time systems are the same. ● Only relative compilation and relative efficiency are measured. C. Kaewkasi 30
  • 31. Benchmarks ● Fibonacci ● Heap sort ● Sieve (prime number computation) ● Fannkuch (pancake flipping) ● Running on ● Core2 Duo 3.0 GHz, Linux 2.6, JDK 1.6.0_b14 ● P4 2.6 GHz, Windows 2000, JDK 1.6.0_b16 ● Both running client and server JVM configurations C. Kaewkasi 31
  • 32. Compilation time measurement ● For Java ● Timing around com.sun.tools.javac.Main ● Benchmarks only. ● For Groovy with typing concerns ● Timing around Groovy's interactive tool ● Benchmarks and their typing aspects. C. Kaewkasi 32
  • 33. Compilation times in Milliseconds C. Kaewkasi 33
  • 34. Execution time measurement ● Both for Java and Groovy with typing concerns ● Run each benchmarks ● Measurement are divided into two parts, start-up time and steady state. C. Kaewkasi 34
  • 35. Fibonacci – Core2 machine C. Kaewkasi 35
  • 36. Fibonacci – Core2 machine C. Kaewkasi 36
  • 37. Fibonacci – P4 machine C. Kaewkasi 37
  • 38. Fibonacci – P4 machine C. Kaewkasi 38
  • 39. Heap sort – Core2 machine C. Kaewkasi 39
  • 40. Heap sort – Core2 machine C. Kaewkasi 40
  • 41. Heap sort – P4 machine C. Kaewkasi 41
  • 42. Heap sort – P4 machine C. Kaewkasi 42
  • 43. Sieve – Core2 machine C. Kaewkasi 43
  • 44. Sieve – Core2 machine C. Kaewkasi 44
  • 45. Sieve – P4 machine C. Kaewkasi 45
  • 46. Sieve – P4 machine C. Kaewkasi 46
  • 47. Fannkuch – Core2 machine C. Kaewkasi 47
  • 48. Fannkuch – Core2 machine C. Kaewkasi 48
  • 49. Fannkuch – P4 machine C. Kaewkasi 49
  • 50. Fannkuch – P4 machine C. Kaewkasi 50
  • 53. Conclusion ● This thesis has introduced a new kind of type- related aspect techniques, typing concerns. ● A technique of advising type information to a certain join point is called type advice. ● This technique has been demonstrated to improve performance of a dynamic language, Groovy. While the technique still preserves its productivity. C. Kaewkasi 53
  • 54. Other contributions ● Type Advice Engine ● A bytecode transformation module for advising type. ● Groovy AOP ● A dynamic AOP implementation. ● FGV calculus ● A core calculus language for studying call site behaviour. ● The term relative compilation to relative productivity metrics C. Kaewkasi 54
  • 55. Future work ● Generalisation of typing concerns to statically typed languages? ● Implementation of Type Advice Engine: ● into virtual machines. ● near the level of virtual machines. ● Combination of typing and parallelisation concerns? ● Further study of appropriate relative productivity metrics for virtual machines. C. Kaewkasi 55
  • 56. Thank you ● Please feel free to ask questions. C. Kaewkasi 56