SlideShare uma empresa Scribd logo
1 de 74
Baixar para ler offline
Mariano Martinez Peck
                                marianopeck@gmail.com
                          http://marianopeck.wordpress.com/



                                          1

Monday, August 22, 2011
THANKS a lot!!!



                             SummerTalk 2011

                          Student: Martin Dias
                          Mentor: Mariano Martínez Peck

                                        2
Monday, August 22, 2011
Object references




                                  3
Monday, August 22, 2011
Object graph




                               4
Monday, August 22, 2011
An objet graph serializer.



                                      5
Monday, August 22, 2011
Serialize
              Input: an object graph




                                           Output: stream of bytes




                                       6
Monday, August 22, 2011
Materialize
                               (deserialize)

                   Input: stream of bytes




                                                Output: an object graph




                                            7
Monday, August 22, 2011
Once serialized...
                              Stream of bytes




            Database           File       Memory   Socket




                                      8
Monday, August 22, 2011
Fuel’s main goals
               Provide fast object serialization and materialization.

               Be flexible and easy to customize.

             Have a good OO design, well tested and
             benchmarked.

               No need of special support from the VM.

               Be a general purpose serializer.

               Allow tools to be built on top of Fuel.
                                        9
Monday, August 22, 2011
Key features
                          Fast serialization and materialization.

                          Class reshape support.

                          Serialization of any kind of object.

                          Cycles support.

                          Global objects references.

                          Buffered writing.

                          Support for some “hook methods”.
                                               10
Monday, August 22, 2011
Key Characteristics
                          Pickle format.

                          Objects grouped in clusters.

                          Analysis phase before writing.

                          Stack over recursion.

                           Two phases for writing instances and
                          references.

                          Iterative graph recreation.
                                               11
Monday, August 22, 2011
Pickle format


      Invest more time in serialization so that objects can then be
                      materialized much faster.




                                   12
Monday, August 22, 2011
Grouping objects in
                        clusters

 “Similar” objects (they share writing/loading information) are
grouped together in clusters. The most common case, yet not the
 only one, takes place when a class is a cluster for its instances.




                                13
Monday, August 22, 2011
14
Monday, August 22, 2011
Each jar has
   a specific
    type of
    element




                          14
Monday, August 22, 2011
Each jar has
   a specific
    type of
    element




    Jars are in
      order


                          14
Monday, August 22, 2011
Label:
                               - What’s inside?
  Each jar has                   - How much?
   a specific
    type of
    element




    Jars are in
      order


                          14
Monday, August 22, 2011
Label:
                               - What’s inside?
  Each jar has                   - How much?
   a specific
    type of
    element

                               Different sizes
                               and different
    Jars are in                 amounts of
      order                      elements


                          14
Monday, August 22, 2011
s/jar/cluster
                                               Label:
                                          - What’s inside?
  Each jar has                              - How much?
   a specific
    type of
    element

                                          Different sizes
                                          and different
    Jars are in                            amounts of
      order                                 elements


                                14
Monday, August 22, 2011
s/jar/cluster
                                               Label:
                                          - What’s inside?
Each jar has                                - How much?
 a specific
  type of
  element
                                          Different sizes
                                          and different
    Jars are in                            amounts of
      order                                 elements


                                14
Monday, August 22, 2011
s/jar/cluster
                                               Label:
                                          - What’s inside?
                                            - How much?
   Each cluster
  has a specific
  type of object


                                          Different sizes
                                          and different
    Jars are in                            amounts of
      order                                 elements


                                14
Monday, August 22, 2011
s/jar/cluster
                                               Label:
                                          - What’s inside?
                                            - How much?
   Each cluster
  has a specific
  type of object


                                          Different sizes
                                          and different
Jars are in                                amounts of
  order                                     elements


                                14
Monday, August 22, 2011
s/jar/cluster
                                               Label:
                                          - What’s inside?
                                            - How much?
   Each cluster
  has a specific
  type of object


                                          Different sizes
                                          and different
  Clusters are                             amounts of
    in order                                elements


                                14
Monday, August 22, 2011
s/jar/cluster
                                               Label:
                                          - What’s inside?
   Each cluster                             - How much?
  has a specific
  type of object


                                           Different sizes
                                           and different
  Clusters are                              amounts of
    in order                                 elements


                                14
Monday, August 22, 2011
s/jar/cluster
                                              Label:
                                           - Cluster ID
   Each cluster                            - Amount of
  has a specific                               objects
  type of object


                                          Different sizes
                                          and different
  Clusters are                             amounts of
    in order                                elements


                                14
Monday, August 22, 2011
s/jar/cluster
                                              Label:
                                           - Cluster ID
   Each cluster                            - Amount of
  has a specific                               objects
  type of object


                                          Different sizes
                                          and different
  Clusters are                             amounts of
    in order                                elements

                                14
Monday, August 22, 2011
s/jar/cluster
                                              Label:
                                           - Cluster ID
   Each cluster                            - Amount of
  has a specific                               objects
  type of object


                                          Different sizes
                                          and different
  Clusters are                             amounts of
    in order                                  objects


                                14
Monday, August 22, 2011
Pickle format basic




                           Stream
                               15
Monday, August 22, 2011
Pickle format basic




                           Stream
                               15
Monday, August 22, 2011
Pickle format basic




                           Stream
                               15
Monday, August 22, 2011
Pickle format basic




                           Stream
                               15
Monday, August 22, 2011
Why the pickle format is so fast in materialization?

            Standard serializers         Fuel pickle format




                                   16
Monday, August 22, 2011
Why the pickle format is so fast in materialization?

            Standard serializers         Fuel pickle format




                           ive                       ive n
                                                rat tio
                      urs tion
                   ec za                    Ite iza
                R                                 ial
                    eri ali                 at er
               m at                       m



                                   16
Monday, August 22, 2011
Pickle advantages
                          Batch/Bulk/Iterative materialization.

                           Efficient since types are stored and fetch only
                          once.

                           Fast because at materialization we know the
                          size of everything.

                          The generated stream is smaller.

                          More next....
                                               17
Monday, August 22, 2011
There is no silver
                              bullet...

                                               ation
                                        rializ e)
                               Fa st se       ickl
                                (with out p


                            Slow
                                 seri
                             (wit aliza
                                 h pi      tion
                                      ckle
                                           )
                                            18
Monday, August 22, 2011
Fuel requires
                          Traversing the object graph.

                          Mapping each object to a specific cluster.



                                This is done in a phase before
                                serialization called “Analysis”.



                                               19
Monday, August 22, 2011
Analysis phase
                                              1) Traverse
                                              (#fuelAccept: aVisitor)
                                              2) Fill dictionary
                                              (#fuelSerializer)



                               cluster1        aPoint      ...
                               cluster2          x          y           ...
                                  ...            ...
                            key (a cluster)          value (a set)
                                       20
Monday, August 22, 2011
Serialization
              cluster1     aPoint     ...
              cluster2       x         y            ...
                 ...         ...
  key (a cluster)           value (a set)


                                                           Cluster
                                               ID

                                               serialize: anObject on: aStream
                                               materializeFrom: aStream

                                            A cluster defines how its objects
                                            are serialized and materialized.
                                       21
Monday, August 22, 2011
Stack over recursion




 To traverse the object graph, Fuel uses a custom
  stack implementation rather than a recursion.
                          22
Monday, August 22, 2011
Basic steps
                 Serialization
                        1. Analyze.
                        2. Serialize header.
                        3. Serialize instances.
                        4. Serialize references.
                        5. Serialize root.

                 Materialization
                      1. Materialize header.
                      2. Materialize instances.
                      3. Materialize references.
                      4. Materialize root.
                                          23
Monday, August 22, 2011
Fuel for far)
                                 (so
                                     software

                          Moose export utility.

                          SandstoneDB persistence.

                          Pier kernel persistence.

                          Newspeak language.

                          Marea (my own research project!).

                                              24
Monday, August 22, 2011
Future Work
                 Continue efforts on performance optimization.

                Create a tool for loading class and trait
                packages.

                 Support user-defined Singletons.

                 Fast statistics/brief info extraction of a stored
                graph.

                 Partial loading of a stored graph.
                                          25
Monday, August 22, 2011
Future work 2

                          Enable to deploy serialization and
                          materialization behavior independently.

                           Support object replacement for serialization
                          and materialization.

                          Allow cycle detections to be disabled.

                          Partial loading.

                                               26
Monday, August 22, 2011
Serialization of primitive objects
                Memory based stream




                                      27
Monday, August 22, 2011
Serialization of primitive objects
                Memory based stream




               StOMP
               SRP
               Fuel                   27
Monday, August 22, 2011
Serialization of primitive objects
                Memory based stream        File based stream




               StOMP
               SRP
               Fuel                   27
Monday, August 22, 2011
Serialization of primitive objects
                Memory based stream        File based stream




               StOMP                            Fuel
               SRP                              SRP
               Fuel                   27        StOMP
Monday, August 22, 2011
Materialization
                          of primitive objects




                                   28
Monday, August 22, 2011
Materialization
                          of primitive objects

                                             Fuel

                                             StOMP


                                             ImageSegment




                                   28
Monday, August 22, 2011
Non primitive objects




                              29
Monday, August 22, 2011
Non primitive objects




               StOMP
               SRP
               Fuel           29
Monday, August 22, 2011
Non primitive objects




               StOMP
               SRP
               Fuel           29
Monday, August 22, 2011
Non primitive objects




               StOMP                Fuel
               SRP                  ImageSegment
               Fuel           29    StOMP
Monday, August 22, 2011
Links
         Website: http://rmod.lille.inria.fr/web/pier/
         software/Fuel

         Issue tracker: http://code.google.com/p/fuel

         Source repository: http://www.squeaksource.com/
         Fuel

         Continuous integration server: https://pharo-
         ic.lille.inria.fr/hudson/job/Fuel/

                                     30
Monday, August 22, 2011
Conclusion
                               for us
                     Excellent performance without special support
                            from VM and good OO design.




                                          31
Monday, August 22, 2011
Conclusion
                                   for YOU
                          Fuel is a vehicle. It is infrastructure. You can
                                    build cool stuff on top of it.




                                                32
Monday, August 22, 2011
Thanks!


                                Mariano Martinez Peck
                                marianopeck@gmail.com
                          http://marianopeck.wordpress.com/




Monday, August 22, 2011
Concrete example



                                 34
Monday, August 22, 2011
35
Monday, August 22, 2011
Analysis phase




                     Analysis      cluster1     aRectangle
                      phase        cluster2     anOrigin aCorner
                                   cluster3     10 20 30 40
                                key (a cluster) value (a IdentitySet)
                                    20
                                    36
Monday, August 22, 2011
cluster1               aRectangle         Serialization
   cluster2               anOrigin aCorner    instances
   cluster3               10 20 30 40           phase




Monday, August 22, 2011
cluster1               aRectangle         Serialization
   cluster2               anOrigin aCorner    instances
   cluster3               10 20 30 40           phase




Monday, August 22, 2011
cluster1               aRectangle            Serialization
   cluster2               anOrigin aCorner       instances
   cluster3               10 20 30 40              phase
            instance variable count          instance variable names

                                                                       instance
  cluster ID                     1 Rectangle 2 origi corne 1             count

   class name




Monday, August 22, 2011
cluster1               aRectangle            Serialization
   cluster2               anOrigin aCorner       instances
   cluster3               10 20 30 40              phase
            instance variable count          instance variable names

                                                                       instance
  cluster ID                     1 Rectangle 2 origi corne 1             count

   class name




Monday, August 22, 2011
cluster1               aRectangle                Serialization
   cluster2               anOrigin aCorner           instances
   cluster3               10 20 30 40                  phase
            instance variable count             instance variable names

                                                                          instance
  cluster ID                     1 Rectangle 2 origi corne 1                count

   class name                    1      Point   2   x     y    2




Monday, August 22, 2011
cluster1               aRectangle                   Serialization
   cluster2               anOrigin aCorner              instances
   cluster3               10 20 30 40                     phase
            instance variable count                 instance variable names

                                                                              instance
  cluster ID                     1 Rectangle 2 origi corne 1                    count

   class name                    1      Point   2      x      y    2

                                 54 10   20 30 40




Monday, August 22, 2011
cluster1               aRectangle                       Serialization
   cluster2               anOrigin aCorner                  references
   cluster3               10 20 30 40                         phase


   instancesIndex
                                          aRectangle 20 40 aCorner anOrigi 10 30
(IdentityDictionary)
                                                1     5    7   3      2     4   6


                                        54 10   20 30 40
                                                               instances
                                                               references


Monday, August 22, 2011
cluster1               aRectangle                       Serialization
   cluster2               anOrigin aCorner                  references
   cluster3               10 20 30 40                         phase


   instancesIndex
                                          aRectangle 20 40 aCorner anOrigi 10 30
(IdentityDictionary)
                                                1     5    7   3      2     4   6


                                        54 10   20 30 40
                                                               instances
                                        2 3
                                                               references


Monday, August 22, 2011
cluster1               aRectangle                       Serialization
   cluster2               anOrigin aCorner                  references
   cluster3               10 20 30 40                         phase


   instancesIndex
                                          aRectangle 20 40 aCorner anOrigi 10 30
(IdentityDictionary)
                                                1     5    7   3      2     4   6


                                        54 10   20 30 40
                                                               instances
                                        2 3
                                                               references

                                        4 5     6 7
Monday, August 22, 2011
cluster1               aRectangle                       Serialization
   cluster2               anOrigin aCorner                  references
   cluster3               10 20 30 40                         phase


   instancesIndex
                                          aRectangle 20 40 aCorner anOrigi 10 30
(IdentityDictionary)
                                                1     5    7   3      2     4   6


                                        54 10   20 30 40
                                                               instances
                                        2 3
                                                               references

                                        4 5     6 7
Monday, August 22, 2011
final stream




                          {
                               1 Rectangle 2 origi corne 1

             instances         1     Point    2   x   y   2

                               54 10   20 30 40


          references
                          {    2 3

                               4 5     6 7


Monday, August 22, 2011
final stream
                                          objectsCounts
                header    {    7 3           clustersCount




                          {
                               1 Rectangle 2 origi corne 1

             instances         1     Point      2   x     y   2

                               54 10   20 30 40


          references
                          {    2 3

                               4 5     6 7

               trailer    {    1         root
Monday, August 22, 2011
Materialization
                                                                      objectsCounts

                                       header {    7    3              clustersCount


                                                   1    Rectangle     2 origin   corner 1



                                instances
                                            {      1        Point     2    x       y   2



                                                   54 1 2 3 4


                                                   2 3
                                  references {
                                                   4 5 6 7

                                       trailer {
                                                    1               root

Monday, August 22, 2011
41
Monday, August 22, 2011

Mais conteúdo relacionado

Mais de ESUG

A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 
BioSmalltalk
BioSmalltalkBioSmalltalk
BioSmalltalkESUG
 
gt4atproto, A Programmable Environment for Social Media
gt4atproto, A Programmable Environment for Social Mediagt4atproto, A Programmable Environment for Social Media
gt4atproto, A Programmable Environment for Social MediaESUG
 
Roassal3 update
Roassal3 updateRoassal3 update
Roassal3 updateESUG
 
VASER Control: Smart Energy
VASER Control: Smart EnergyVASER Control: Smart Energy
VASER Control: Smart EnergyESUG
 
Do you know your browser?
Do you know your browser?Do you know your browser?
Do you know your browser?ESUG
 
News on Bloc for Pharo
News on Bloc for PharoNews on Bloc for Pharo
News on Bloc for PharoESUG
 
Do you really understand Git?
Do you really understand Git?Do you really understand Git?
Do you really understand Git?ESUG
 

Mais de ESUG (20)

A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 
BioSmalltalk
BioSmalltalkBioSmalltalk
BioSmalltalk
 
gt4atproto, A Programmable Environment for Social Media
gt4atproto, A Programmable Environment for Social Mediagt4atproto, A Programmable Environment for Social Media
gt4atproto, A Programmable Environment for Social Media
 
Roassal3 update
Roassal3 updateRoassal3 update
Roassal3 update
 
VASER Control: Smart Energy
VASER Control: Smart EnergyVASER Control: Smart Energy
VASER Control: Smart Energy
 
Do you know your browser?
Do you know your browser?Do you know your browser?
Do you know your browser?
 
News on Bloc for Pharo
News on Bloc for PharoNews on Bloc for Pharo
News on Bloc for Pharo
 
Do you really understand Git?
Do you really understand Git?Do you really understand Git?
Do you really understand Git?
 

Último

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 

Último (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Fuel

  • 1. Mariano Martinez Peck marianopeck@gmail.com http://marianopeck.wordpress.com/ 1 Monday, August 22, 2011
  • 2. THANKS a lot!!! SummerTalk 2011 Student: Martin Dias Mentor: Mariano Martínez Peck 2 Monday, August 22, 2011
  • 3. Object references 3 Monday, August 22, 2011
  • 4. Object graph 4 Monday, August 22, 2011
  • 5. An objet graph serializer. 5 Monday, August 22, 2011
  • 6. Serialize Input: an object graph Output: stream of bytes 6 Monday, August 22, 2011
  • 7. Materialize (deserialize) Input: stream of bytes Output: an object graph 7 Monday, August 22, 2011
  • 8. Once serialized... Stream of bytes Database File Memory Socket 8 Monday, August 22, 2011
  • 9. Fuel’s main goals Provide fast object serialization and materialization. Be flexible and easy to customize. Have a good OO design, well tested and benchmarked. No need of special support from the VM. Be a general purpose serializer. Allow tools to be built on top of Fuel. 9 Monday, August 22, 2011
  • 10. Key features Fast serialization and materialization. Class reshape support. Serialization of any kind of object. Cycles support. Global objects references. Buffered writing. Support for some “hook methods”. 10 Monday, August 22, 2011
  • 11. Key Characteristics Pickle format. Objects grouped in clusters. Analysis phase before writing. Stack over recursion. Two phases for writing instances and references. Iterative graph recreation. 11 Monday, August 22, 2011
  • 12. Pickle format Invest more time in serialization so that objects can then be materialized much faster. 12 Monday, August 22, 2011
  • 13. Grouping objects in clusters “Similar” objects (they share writing/loading information) are grouped together in clusters. The most common case, yet not the only one, takes place when a class is a cluster for its instances. 13 Monday, August 22, 2011
  • 15. Each jar has a specific type of element 14 Monday, August 22, 2011
  • 16. Each jar has a specific type of element Jars are in order 14 Monday, August 22, 2011
  • 17. Label: - What’s inside? Each jar has - How much? a specific type of element Jars are in order 14 Monday, August 22, 2011
  • 18. Label: - What’s inside? Each jar has - How much? a specific type of element Different sizes and different Jars are in amounts of order elements 14 Monday, August 22, 2011
  • 19. s/jar/cluster Label: - What’s inside? Each jar has - How much? a specific type of element Different sizes and different Jars are in amounts of order elements 14 Monday, August 22, 2011
  • 20. s/jar/cluster Label: - What’s inside? Each jar has - How much? a specific type of element Different sizes and different Jars are in amounts of order elements 14 Monday, August 22, 2011
  • 21. s/jar/cluster Label: - What’s inside? - How much? Each cluster has a specific type of object Different sizes and different Jars are in amounts of order elements 14 Monday, August 22, 2011
  • 22. s/jar/cluster Label: - What’s inside? - How much? Each cluster has a specific type of object Different sizes and different Jars are in amounts of order elements 14 Monday, August 22, 2011
  • 23. s/jar/cluster Label: - What’s inside? - How much? Each cluster has a specific type of object Different sizes and different Clusters are amounts of in order elements 14 Monday, August 22, 2011
  • 24. s/jar/cluster Label: - What’s inside? Each cluster - How much? has a specific type of object Different sizes and different Clusters are amounts of in order elements 14 Monday, August 22, 2011
  • 25. s/jar/cluster Label: - Cluster ID Each cluster - Amount of has a specific objects type of object Different sizes and different Clusters are amounts of in order elements 14 Monday, August 22, 2011
  • 26. s/jar/cluster Label: - Cluster ID Each cluster - Amount of has a specific objects type of object Different sizes and different Clusters are amounts of in order elements 14 Monday, August 22, 2011
  • 27. s/jar/cluster Label: - Cluster ID Each cluster - Amount of has a specific objects type of object Different sizes and different Clusters are amounts of in order objects 14 Monday, August 22, 2011
  • 28. Pickle format basic Stream 15 Monday, August 22, 2011
  • 29. Pickle format basic Stream 15 Monday, August 22, 2011
  • 30. Pickle format basic Stream 15 Monday, August 22, 2011
  • 31. Pickle format basic Stream 15 Monday, August 22, 2011
  • 32. Why the pickle format is so fast in materialization? Standard serializers Fuel pickle format 16 Monday, August 22, 2011
  • 33. Why the pickle format is so fast in materialization? Standard serializers Fuel pickle format ive ive n rat tio urs tion ec za Ite iza R ial eri ali at er m at m 16 Monday, August 22, 2011
  • 34. Pickle advantages Batch/Bulk/Iterative materialization. Efficient since types are stored and fetch only once. Fast because at materialization we know the size of everything. The generated stream is smaller. More next.... 17 Monday, August 22, 2011
  • 35. There is no silver bullet... ation rializ e) Fa st se ickl (with out p Slow seri (wit aliza h pi tion ckle ) 18 Monday, August 22, 2011
  • 36. Fuel requires Traversing the object graph. Mapping each object to a specific cluster. This is done in a phase before serialization called “Analysis”. 19 Monday, August 22, 2011
  • 37. Analysis phase 1) Traverse (#fuelAccept: aVisitor) 2) Fill dictionary (#fuelSerializer) cluster1 aPoint ... cluster2 x y ... ... ... key (a cluster) value (a set) 20 Monday, August 22, 2011
  • 38. Serialization cluster1 aPoint ... cluster2 x y ... ... ... key (a cluster) value (a set) Cluster ID serialize: anObject on: aStream materializeFrom: aStream A cluster defines how its objects are serialized and materialized. 21 Monday, August 22, 2011
  • 39. Stack over recursion To traverse the object graph, Fuel uses a custom stack implementation rather than a recursion. 22 Monday, August 22, 2011
  • 40. Basic steps Serialization 1. Analyze. 2. Serialize header. 3. Serialize instances. 4. Serialize references. 5. Serialize root. Materialization 1. Materialize header. 2. Materialize instances. 3. Materialize references. 4. Materialize root. 23 Monday, August 22, 2011
  • 41. Fuel for far) (so software Moose export utility. SandstoneDB persistence. Pier kernel persistence. Newspeak language. Marea (my own research project!). 24 Monday, August 22, 2011
  • 42. Future Work Continue efforts on performance optimization. Create a tool for loading class and trait packages. Support user-defined Singletons. Fast statistics/brief info extraction of a stored graph. Partial loading of a stored graph. 25 Monday, August 22, 2011
  • 43. Future work 2 Enable to deploy serialization and materialization behavior independently. Support object replacement for serialization and materialization. Allow cycle detections to be disabled. Partial loading. 26 Monday, August 22, 2011
  • 44. Serialization of primitive objects Memory based stream 27 Monday, August 22, 2011
  • 45. Serialization of primitive objects Memory based stream StOMP SRP Fuel 27 Monday, August 22, 2011
  • 46. Serialization of primitive objects Memory based stream File based stream StOMP SRP Fuel 27 Monday, August 22, 2011
  • 47. Serialization of primitive objects Memory based stream File based stream StOMP Fuel SRP SRP Fuel 27 StOMP Monday, August 22, 2011
  • 48. Materialization of primitive objects 28 Monday, August 22, 2011
  • 49. Materialization of primitive objects Fuel StOMP ImageSegment 28 Monday, August 22, 2011
  • 50. Non primitive objects 29 Monday, August 22, 2011
  • 51. Non primitive objects StOMP SRP Fuel 29 Monday, August 22, 2011
  • 52. Non primitive objects StOMP SRP Fuel 29 Monday, August 22, 2011
  • 53. Non primitive objects StOMP Fuel SRP ImageSegment Fuel 29 StOMP Monday, August 22, 2011
  • 54. Links Website: http://rmod.lille.inria.fr/web/pier/ software/Fuel Issue tracker: http://code.google.com/p/fuel Source repository: http://www.squeaksource.com/ Fuel Continuous integration server: https://pharo- ic.lille.inria.fr/hudson/job/Fuel/ 30 Monday, August 22, 2011
  • 55. Conclusion for us Excellent performance without special support from VM and good OO design. 31 Monday, August 22, 2011
  • 56. Conclusion for YOU Fuel is a vehicle. It is infrastructure. You can build cool stuff on top of it. 32 Monday, August 22, 2011
  • 57. Thanks! Mariano Martinez Peck marianopeck@gmail.com http://marianopeck.wordpress.com/ Monday, August 22, 2011
  • 58. Concrete example 34 Monday, August 22, 2011
  • 60. Analysis phase Analysis cluster1 aRectangle phase cluster2 anOrigin aCorner cluster3 10 20 30 40 key (a cluster) value (a IdentitySet) 20 36 Monday, August 22, 2011
  • 61. cluster1 aRectangle Serialization cluster2 anOrigin aCorner instances cluster3 10 20 30 40 phase Monday, August 22, 2011
  • 62. cluster1 aRectangle Serialization cluster2 anOrigin aCorner instances cluster3 10 20 30 40 phase Monday, August 22, 2011
  • 63. cluster1 aRectangle Serialization cluster2 anOrigin aCorner instances cluster3 10 20 30 40 phase instance variable count instance variable names instance cluster ID 1 Rectangle 2 origi corne 1 count class name Monday, August 22, 2011
  • 64. cluster1 aRectangle Serialization cluster2 anOrigin aCorner instances cluster3 10 20 30 40 phase instance variable count instance variable names instance cluster ID 1 Rectangle 2 origi corne 1 count class name Monday, August 22, 2011
  • 65. cluster1 aRectangle Serialization cluster2 anOrigin aCorner instances cluster3 10 20 30 40 phase instance variable count instance variable names instance cluster ID 1 Rectangle 2 origi corne 1 count class name 1 Point 2 x y 2 Monday, August 22, 2011
  • 66. cluster1 aRectangle Serialization cluster2 anOrigin aCorner instances cluster3 10 20 30 40 phase instance variable count instance variable names instance cluster ID 1 Rectangle 2 origi corne 1 count class name 1 Point 2 x y 2 54 10 20 30 40 Monday, August 22, 2011
  • 67. cluster1 aRectangle Serialization cluster2 anOrigin aCorner references cluster3 10 20 30 40 phase instancesIndex aRectangle 20 40 aCorner anOrigi 10 30 (IdentityDictionary) 1 5 7 3 2 4 6 54 10 20 30 40 instances references Monday, August 22, 2011
  • 68. cluster1 aRectangle Serialization cluster2 anOrigin aCorner references cluster3 10 20 30 40 phase instancesIndex aRectangle 20 40 aCorner anOrigi 10 30 (IdentityDictionary) 1 5 7 3 2 4 6 54 10 20 30 40 instances 2 3 references Monday, August 22, 2011
  • 69. cluster1 aRectangle Serialization cluster2 anOrigin aCorner references cluster3 10 20 30 40 phase instancesIndex aRectangle 20 40 aCorner anOrigi 10 30 (IdentityDictionary) 1 5 7 3 2 4 6 54 10 20 30 40 instances 2 3 references 4 5 6 7 Monday, August 22, 2011
  • 70. cluster1 aRectangle Serialization cluster2 anOrigin aCorner references cluster3 10 20 30 40 phase instancesIndex aRectangle 20 40 aCorner anOrigi 10 30 (IdentityDictionary) 1 5 7 3 2 4 6 54 10 20 30 40 instances 2 3 references 4 5 6 7 Monday, August 22, 2011
  • 71. final stream { 1 Rectangle 2 origi corne 1 instances 1 Point 2 x y 2 54 10 20 30 40 references { 2 3 4 5 6 7 Monday, August 22, 2011
  • 72. final stream objectsCounts header { 7 3 clustersCount { 1 Rectangle 2 origi corne 1 instances 1 Point 2 x y 2 54 10 20 30 40 references { 2 3 4 5 6 7 trailer { 1 root Monday, August 22, 2011
  • 73. Materialization objectsCounts header { 7 3 clustersCount 1 Rectangle 2 origin corner 1 instances { 1 Point 2 x y 2 54 1 2 3 4 2 3 references { 4 5 6 7 trailer { 1 root Monday, August 22, 2011