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
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
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