Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JooFlux at ComPAS 2013
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Julien Ponge
January 16, 2013
Research
470
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JooFlux at ComPAS 2013
Julien Ponge
January 16, 2013
More Decks by Julien Ponge
See All by Julien Ponge
Quarkus Insights 2023-03-06
jponge
0
130
Reactive Streams. 4 Interfaces. Et après ?
jponge
0
65
Scalability and resilience in practice: current trends and opportunities
jponge
0
310
Eclipse Vert.x at BruJUG 2019
jponge
0
210
Du réactif au service du pneu connecté
jponge
0
400
Bringing Reactive to Enterprise Java Developers
jponge
0
350
Golo LyonJUG 2019
jponge
0
300
Vert.x Montreal JUG 2018
jponge
0
550
Bringing Reactive to Enterprise Application Developer // Reactive Summit 2018
jponge
0
300
Other Decks in Research
See All in Research
Apache Gravitinoで実現する Icebergカタログ統合とアクセスの一元化
matsumooon
0
350
通時的な類似度行列に基づく単語の意味変化の分析
rudorudo11
0
340
【ローカルAIに向き合う展示会vol.2】液体時間定数型モジュールを用いた オリジナルの双方向エンコーダーモデルNexteraBERT 推論速度向上検討並びにダウンストリーム評価
rikkabotan7
0
130
老舗ものづくり企業でリサーチが変革を起こすまで - 三菱重工DXの実践
skydats
0
230
COMETAを用いたデータ民主化運動の歴史
sazimai
0
130
[CV勉強会@関東 CVPR2026] PSDesigner: Automated Graphic Design with a Human-Like Creative Workflow / kantocv 67th CVPR 2026
shunk031
0
190
Spatial Active Noise Control Based onSound Field Interpolation Incorporating Physical Constraints
skoyamalab
0
130
Cross-Media Human-Information Interaction
signer
PRO
0
130
コーディングエージェントとABNを再考
hf149
2
780
研究室単位での自律的 IPv6接続性確立に向けたAS共同運用モデルの提案と実証
reokashiwa
PRO
0
160
「行ける・行けない表」による地域公共交通の性能評価
bansousha
0
170
適応的スパムフィルタのための軽量な類似メッセージカウンタ / jsai2026-adaptive-spam-filter
monochromegane
0
4.5k
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1033
470k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
230
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
980
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
350
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
330
Code Review Best Practice
trishagee
74
20k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
270
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
640
Transcript
Julien Ponge Frédéric Le Mouël JooFlux ComPAS 2013
Objectifs JVM, invokedynamic Implémentation Évaluation Conclusions
“Modification de code à chaud et injection d’aspects directement dans
une JVM 7”
(démo)
AspectJ [Kiczales et al., 2001, CACM] Byteman [Dinn, 2011, AOSD]
Steamloom [Bockisch et al., 2004, AOSD] JnVM [Thomas et al., 2008, SP+E] JVolve [Subramanian et al., 2009, PLDI] SafeWeave [Würthinger et al., 2011, OOPSLA] Outils VMs ad-hoc Travaux connexes
Pas de langage d’aspects Pas de pré/post compilation Un agent
Java JVM non-modifiée JooFlux Dév appli Runtime
JVM, invokedynamic
Machine à pile OpCodes invocation de méthode manipulation de pile
get / set champs arithmétique allocation sauts lock (...) Constant pool (nombres, String, types) 0 java/lang/String 1 “Foo” 2 666 ... ... Variables locales 0 this (sauf static) 1 arg1 2 arg2 3 int i ... ...
invokestatic public static int add(int a, int b) invokevirtual public
int add(int a, int b) invokeinterface int add(int a, int b) invokespecial private int add(int a, int b)
Object call (Object receiver, Object[] args) throws Throwable; Object call
(Object receiver) throws Throwable; Object call (Object receiver, Object arg1) throws Throwable; Object call (Object receiver, Object arg1, Object arg2) throws Throwable; Object call (Object receiver, Object arg1, Object arg2, Object arg3) throws Throwable; Object call (Object receiver, Object arg1, Object arg2, Object arg3, Object arg4) throws Throwable; Object callConstructor (Object receiver, Object [] args) throws Throwable; Object callConstructor (Object receiver) throws Throwable; Object callConstructor (Object receiver, Object arg1) throws Throwable; Object callConstructor (Object receiver, Object arg1, Object arg2) throws Throwable; Object callConstructor (Object receiver, Object arg1, Object arg2, Object arg3) throws Throwable; Object callConstructor (Object receiver, Object arg1, Object arg2, Object arg3, Object arg4) throws Throwable; Comment résoudre à l’exécution ? (extrait de Groovy)
public Object call(Object receiver, Object[] args) throws Throwable { return
CallSiteArray.defaultCall(this, receiver, args); } public Object call(Object receiver) throws Throwable { return call(receiver, CallSiteArray.NOPARAM); } public Object call(Object receiver, Object arg1) throws Throwable { return call(receiver, ArrayUtil.createArray(arg1)); } public Object call(Object receiver, Object arg1, Object arg2) throws Throwable { return call(receiver, ArrayUtil.createArray(arg1, arg2)); } public Object call(Object receiver, Object arg1, Object arg2, Object arg3) throws Throwable { return call(receiver, ArrayUtil.createArray(arg1, arg2, arg3)); } public Object call(Object receiver, Object arg1, Object arg2, Object arg3, Object arg4) throws Throwable { return call(receiver, ArrayUtil.createArray(arg1, arg2, arg3, arg4)); } “Tous les chemins mènent à Rome”
public static Object invoke(Object object, String methodName, Object[] parameters) {
try { Class[] classTypes = new Class[parameters.length]; for (int i = 0; i < classTypes.length; i++) { classTypes[i] = parameters[i].getClass(); } Method method = object.getClass().getMethod(methodName, classTypes); return method.invoke(object, parameters); } catch (Throwable t) { return InvokerHelper.invokeMethod(object, methodName, parameters); } } Difficile pour le JIT ! CallSites génériques Réflexivité
invokedynamic nom symbolique + signature + bootstrap CallSite Constant Mutable
Volatile MethodHandle direct ou combinateurs branchements adaptation filtres (...) 7
Implémentation
1 2 3 4 Chargement des classes Interception Management Runtime
(...) ldc #3 ldc #5 invokedynamic foo (II)I bootstraper (...)
Call site JMX agent JooFlux bootstraper Modified bytecode Registry Target method combinators Load time action Run time action Original bytecode JVM agent 1 2 3 4
Réécriture de bytecode ASM + Agent Bootstrap JooFlux Casse la
vérification de bytecode ! 1
sémantique champ volatile impact mesuré négligeable VolatileCallSite 2
invokestatic invokespecial Method handle direct invokevirtual invokeinterface Method handle sur
le premier receveur 3
invokeinterface Polymorphic inline-cache guardWithTest(Class1, obj) guardWithTest(Class2, obj) fallback(callsite, args[]) Class1#foo(II)I
Class2#foo(II)I obj.foo(1, 2) 3
4 public interface JooFluxManagementMXBean { public String getName(); public int
getNumberOfRegisteredCallSites(); public Set<String> getRegisteredCallSiteKeys(); public String getCallSiteType(String target); public void changeCallSiteTarget(String methodType, String oldTarget, String newTarget); public void applyBeforeAspect(String callSitesKey, String aspectClass, String aspectMethod); public void applyAfterAspect(String callSitesKey, String aspectClass, String aspectMethod); }
(...) ldc #3 ldc #5 invokedynamic foo (II)I bootstraper (...)
Call site JMX agent JooFlux bootstraper Modified bytecode Registry Target method combinators Load time action Run time action Original bytecode JVM agent 4 Registre : 0 impact perfs Enregistré à la 1ère interception Modification via API
Évaluation
Interception / redirection de méthode Injection d’aspect ‘vide’ Langages dynamiques
Plates-formes AOP Micro Fibonacci(40) Macro SCImark Fork/Join Clojure Benchmarks X V V V
0 2 4 6 8 Byteman Jooflux Avant Après Avant
+ Après Injection d’aspect ‘vide’ x 137 x 134 x 306 x 6 x 2 x 5 Microbench
Interception/redirection méthode 0 5 10 15 Clojure JRuby Groovy Rhino
JS Jython Java+JooFlux Min Max x 1 x 48 x 18 x 15 x 2,2 x 10 x 3 x 6 x 1,2 x 2 Microbench
Interception/redirection méthode 0.9 1 1.1 SCIMark Fork/Join Clojure Min Max
x 0,99 x 0,97 x 1,04 x 0,93 x 1,01 x 1,01 Macrobench
Conclusion
JVM généraliste Interception à grain fin Résultats initiaux encourageants Approche
nouvelle, générique, sans langage dédié Bilan
Injection atomique multi-aspects Rollback / versioning Vérification formelle pré-injection Aspects
contextuels / Internet of Things Contrôle de ressources avec isolation adaptative Perspectives
https://github.com/dynamid/jooflux Questions / réponses Julien Ponge Frédéric Le Mouël http://dynamid.citi-lab.fr/