Improving Performance Through Object Lifetime Profiling: the DataFrame Case
1. Improving Performance Through
Object Lifetime Pro
fi
ling: the
DataFrame Case
Sebastian JORDAN MONTAÑO, Nahuel PALUMBO, Guillermo POLITO,
Stéphane DUCASSE and Pablo TESONE
Inria, Univ. Lille, CNRS, Centrale Lille, UMR 9189 - CRIStAL
August 2023 Evref
fervE
7. An object’s lifetime
Object’s allocation
Object becomes
unreachable
GC collects
the object
Actual lifetime
Lifetime that we capture?
7
8. An object’s approximated lifetime
Object’s allocation
Object becomes
unreachable
GC prepares
the object
Actual lifetime
Lifetime that we capture
Object is
fi
nalized
(we take the measurement)
8
10. Capturing the allocations
Array new: 7
10
Capture the allocation
Register the
fi
nalization
MethodProxies [1]
Ephemerons [2]
[1] github.com/pharo-contributions/MethodProxies
[2] github.com/pharo-project/pheps/blob/main/phep-0003.md
11. An object’s finalization at a time m
11
Ephemeron
#111
Object: Array
#123
Model
allocationTime: n
finalizationTime: m
m
o
u
r
n
finalize
E
p
h
e
m
e
r
o
n
i
s
c
o
n
s
u
m
e
d
1 2
3
key
Finalization Queue
Object #123 is
garbage collected
4
12. An object’s allocation at a time n
12
OrderedCollection class >> new: anInteger
^ self basicNew setCollection:
(self arrayType new: anInteger)
Behavior >> basicNew
<primitive: 70>
Array class >> basicNew: size
lines := OrderedCollection new
...
14. Methodology
14
Application’s Lifetime Profile
P
Application to Profile
3. Chose GC tuned
parameters based on
object lifetimes and
benchmark information
5. Did the performance improved?
GC tuned
parameters
2. Benchmark it with the
default GC parameters
4. Benchmark the application
again with the tuned GC parameters
1. Profile the application
Default GC parameters
benchmark
Tuned GC parameters
benchmark
24. Future work
Measure the precision of our approximate object lifetimes
Pro
fi
ling at VM level to reduce the overhead
Pre-tenuring
24
25. Summary
We developed a lifetime profiler
We profiled the object lifetimes and we validated our solution by
observing how lifetimes relate to performance improvements when
tuning the GC.
25
github.com/jordanmontt/illimani-memory-pro
fi
ler
Sebastian JORDAN MONTAÑO
sebastian.jordan@inria.fr