ݺߣ

ݺߣShare a Scribd company logo
Optimizing Performance and Scalability in
Low-Code / No-Code DMN Platforms
September 2024
Content
2
 Problem Statement
 Problem Solution
 Overall structure of jDMN
 Transpiler to Java / Kotlin / Python
 Code optimisation
 Q&As
Problem Statement
3
 Challenging BDM environment
 High risk decisions
 Fast-release cycles
 High Tech Risk
 High number of executions
 Quality
 functionality, reliability, usability, flexibility, efficiency, maintainability
 LCNCP platform
 Attributes in scope
 Efficiency
 performance
 scalability
jDMN: Overall Structure
4
 DMN Processors
 Reader / Writer
 Validators
 Transformers
 Interpreter
 Translator
 Dialects
 DMN 1.1 – 1.5
 Signavio
jDMN: Overall Structure
5
Semantic Analyzer
Semantic
Tree
AST
Lexical
Analyzer
Source
Text
Parser
Source
Tokens
Syntax Analyzer
Code
Generator
Interpreter
Error Manager
& Logger
Translation
6
jDMN: Translation
7
jDMN: Translation
8
 How did we built it?
 Syntax-Driven Translation Schematas (SDTS)
 Based on Knuth’s attributed grammars
 Synthesized attributes
 Inherited Attributes
Expr1 → Expr2 + Term { Expr1.value = Expr2.value + Term.value }
Expr → Term { Expr.value = Term.value }
Term1 → Term2 * Factor { Term1.value = Term2.value * Factor.value }
Term → Factor { Term.value = Factor.value }
Factor → "(" Expr ") { Factor.value = Expr.value }
Factor → integer { Factor.value = strToInt(integer.str) }
jDMN: Translation
9
 Advantages include
 Performance: we have seen runtimes 4-10 times faster than
previous engine execution in complex decision tests
 Stability: given that we now control the code generation, we are
able to resolve issues without relying on the vendor
 Functionality: the fact that we control the code generation
means that we are also able to enable more advanced
functionality for DMN/Java models
Code Optimisation – Model Level
10
 AWS Lambda
 gRPC / protobuf
Users
Message Bus
AWS Stack
Code Optimisation – DRG Element Level
11
 Caching
 Map-reduce for
 MID
Code Optimisation – DRG Element Level
12
 Lazy evaluation
 Inner nodes (Decisions, BKMs, Decision Services)
 Leaves (Input Data)
Code Optimisation – DRG Element Level
13
Performance Before DRG Optimization
Decision
Name
Request
Count
Response
Time 90th
(ms)
Min
Response
Time (ms)
Max
Response
Time (ms)
D1 12899 40 4 5562
D2 361 6676 21 9653
D3 28731 15 1 933
D4 86165 39 4 6367
Performance After DRG Optimization
Decision
Name
Request
Count
Response
Time 90th
(ms)
Min
Response
Time (ms)
Max
Response
Time (ms)
D1 12899 35 5 7150
D2 361 315 153 4603
D3 28745 12 1 606
D4 86204 37 4 7736
Code Optimisation at FEEL level
14
 Native Types
 Built-in functions
 Native Compiler / Interpreter (e.g. JIT compiler)
What next?
15
 Enhance lazy evaluation
 Three Address Code optimization
Questions?
16
https://github.com/goldmansachs/jdmn

More Related Content

jDMN - DecisionCamp 2024.pptx presentación presentación

  • 1. Optimizing Performance and Scalability in Low-Code / No-Code DMN Platforms September 2024
  • 2. Content 2  Problem Statement  Problem Solution  Overall structure of jDMN  Transpiler to Java / Kotlin / Python  Code optimisation  Q&As
  • 3. Problem Statement 3  Challenging BDM environment  High risk decisions  Fast-release cycles  High Tech Risk  High number of executions  Quality  functionality, reliability, usability, flexibility, efficiency, maintainability  LCNCP platform  Attributes in scope  Efficiency  performance  scalability
  • 4. jDMN: Overall Structure 4  DMN Processors  Reader / Writer  Validators  Transformers  Interpreter  Translator  Dialects  DMN 1.1 – 1.5  Signavio
  • 5. jDMN: Overall Structure 5 Semantic Analyzer Semantic Tree AST Lexical Analyzer Source Text Parser Source Tokens Syntax Analyzer Code Generator Interpreter Error Manager & Logger
  • 8. jDMN: Translation 8  How did we built it?  Syntax-Driven Translation Schematas (SDTS)  Based on Knuth’s attributed grammars  Synthesized attributes  Inherited Attributes Expr1 → Expr2 + Term { Expr1.value = Expr2.value + Term.value } Expr → Term { Expr.value = Term.value } Term1 → Term2 * Factor { Term1.value = Term2.value * Factor.value } Term → Factor { Term.value = Factor.value } Factor → "(" Expr ") { Factor.value = Expr.value } Factor → integer { Factor.value = strToInt(integer.str) }
  • 9. jDMN: Translation 9  Advantages include  Performance: we have seen runtimes 4-10 times faster than previous engine execution in complex decision tests  Stability: given that we now control the code generation, we are able to resolve issues without relying on the vendor  Functionality: the fact that we control the code generation means that we are also able to enable more advanced functionality for DMN/Java models
  • 10. Code Optimisation – Model Level 10  AWS Lambda  gRPC / protobuf Users Message Bus AWS Stack
  • 11. Code Optimisation – DRG Element Level 11  Caching  Map-reduce for  MID
  • 12. Code Optimisation – DRG Element Level 12  Lazy evaluation  Inner nodes (Decisions, BKMs, Decision Services)  Leaves (Input Data)
  • 13. Code Optimisation – DRG Element Level 13 Performance Before DRG Optimization Decision Name Request Count Response Time 90th (ms) Min Response Time (ms) Max Response Time (ms) D1 12899 40 4 5562 D2 361 6676 21 9653 D3 28731 15 1 933 D4 86165 39 4 6367 Performance After DRG Optimization Decision Name Request Count Response Time 90th (ms) Min Response Time (ms) Max Response Time (ms) D1 12899 35 5 7150 D2 361 315 153 4603 D3 28745 12 1 606 D4 86204 37 4 7736
  • 14. Code Optimisation at FEEL level 14  Native Types  Built-in functions  Native Compiler / Interpreter (e.g. JIT compiler)
  • 15. What next? 15  Enhance lazy evaluation  Three Address Code optimization