Strumenta / kolasu

Kotlin Language Support – AST Library
Apache License 2.0
111 stars 12 forks source link

Measure performance of a couple of parsers w.r.t Kolasu 1.5 #354

Open ftomassetti opened 3 months ago

psuzzi commented 1 month ago

Would it make sense to compare Kolasu with ANTLR v4 and Xtext?

psuzzi commented 1 month ago

Initial results comparing Kolasu to pure-ANTLR on parsing the same set of 90 files suggest that:

INFO: KOLASU FULL TEST
{
  "folder_path" : "/home/runner/work/parse-test/parse-test/parse-test-benchmark/target/test-classes/arithmetic_expr_gen",
  "number_of_files" : 90,
  "total_parsing_time_ms" : 36216,
  "total_memory_used_kb" : 339968
}
INFO: ANTLR FULL TEST
{
  "folder_path" : "/home/runner/work/parse-test/parse-test/parse-test-benchmark/target/test-classes/arithmetic_expr_gen",
  "number_of_files" : 90,
  "total_parsing_time_ms" : 556,
  "total_memory_used_kb" : 287662
}

Note:

ftomassetti commented 1 month ago

Hi @psuzzi sorry for the late reply. This issue is indeed very poorly written, but what we meant was that we wanted to compare the performance of parsers built with 1.5 and with the branch currently under development (1.6). This new branch includes very significant changes and we wonder about the impact of those changes on performance. I think the comparison with ANTLR is also interesting, as we can deduct what kind of overhead we put on top of ANTLR. Thank you for performing such comparison.

psuzzi commented 4 weeks ago

Thanks for the clarification. In the benchmark repository, I added a new issue Add Kolasu 1.6 to the comparison , and I stopped the efforts for solving Xtext integration issues, as it makes little sense.

psuzzi commented 2 weeks ago

I can now test with multiple versions of Kolasu, but I can't get 1.6

I observed there is no 1.6.0-* version of kolasu released on maven central.

Otherwise, I can build the 1.6.0-Alpha1 (tag) or 1.6.0-Alpha2-SNAPSHOT (current main), and add the libraries to the project. In this second case, correct me if wrong, I will need to build both core-1.6.0-Alpha2-SNAPSHOT.jar and ast-jvm-1.6.0-Alpha2-SNAPSHOT.jar, but then I have a dependency issue with reaktive's PublishSubjectBuilderKt.

c/c @ftomassetti

ftomassetti commented 1 week ago

Hi Patrik. 1.6 has not yet been released on Maven Central and it is under development. At this time is not documented so I would not invest time on it, and working that out would be too time consuming