Closed vitorpamplona closed 10 months ago
Some interesting early results on the performance of specific methods in the stack:
Compile:
CqlTranslator translator = CqlTranslator.fromText(cqlText, modelManager, new LibraryManager(modelManager), ucumService, opts);
Map (uses the CQL-Evaluator's Mapper):
Library l1 = LibraryMapper.INSTANCE.map(translator.toELM());
Parsing:
Library l2 = JsonCqlLibraryReader.read(new StringReader(translator.toJxson()));
Delta time and delta memory (before GC) of repeating 10 times the same compilation + mapping | parsing. Desktop runs
Compile Mapping Parsing Lib
ΔTime ΔMemory ΔTime ΔMemory ΔTime ΔMemory Lib
3025ms +173mb 242ms +20mb 1340ms +82mb CqlIntervalOperatorsTest.cql
505ms +96mb 15ms +0mb 331ms +45mb CqlIntervalOperatorsTest.cql
438ms +96mb 12ms +0mb 311ms +42mb CqlIntervalOperatorsTest.cql
388ms +96mb 7ms +0mb 242ms +43mb CqlIntervalOperatorsTest.cql
349ms +96mb 6ms +0mb 225ms +42mb CqlIntervalOperatorsTest.cql
359ms +92mb 8ms +4mb 277ms +41mb CqlIntervalOperatorsTest.cql
426ms +92mb 8ms +0mb 200ms +41mb CqlIntervalOperatorsTest.cql
283ms +96mb 5ms +0mb 246ms +43mb CqlIntervalOperatorsTest.cql
319ms +92mb 5ms +0mb 185ms +45mb CqlIntervalOperatorsTest.cql
207ms +92mb 13ms +0mb 172ms +43mb CqlIntervalOperatorsTest.cql
I have no idea why compiling the same file gets faster every time you do it :)
Compiling something larger puts us well beyond the 1GB/compile.
Compile Mapping Parsing Lib
ΔTime ΔMemory ΔTime ΔMemory ΔTime ΔMemory Lib
9976ms +1394mb 642ms +29mb 3655ms +357mb CqlTestSuite.cql
4550ms +1272mb 70ms +8mb 1781ms +297mb CqlTestSuite.cql
3552ms +1264mb 65ms +8mb 1496ms +298mb CqlTestSuite.cql
3861ms +1264mb 59ms +8mb 1323ms +296mb CqlTestSuite.cql
3921ms +1260mb 103ms +8mb 1263ms +296mb CqlTestSuite.cql
3727ms +1265mb 52ms +8mb 1339ms +294mb CqlTestSuite.cql
No longer needed, engine and compiler share ELM graph
Currently, the engine uses a JSON mapper to compile CQL into evaluation-ready elm classes. All tests run a similar line to this:
We have to find a way to directly compile CQL into evaluation classes to improve performance and memory use.