Comments (7)
Hi @martinflorek,
please try version fd6123da02
. Can you tell me the required parsing time of the old and the new version? Thank you very much!
from ast.
I am not able to properly measure the parsing time only, because I process several source code repositories at once and I am looking for specific files only before parsing them.
But the new version runs a bit faster. All my processing went from ~33 seconds to ~32 seconds. Version with Kastree runs in 1.7 seconds.
from ast.
I refactored kotlinx.ast
so that it is now possible to use both antlr-kotlin
and antlr-java
to parse kotlin sources.
Example: https://github.com/kotlinx/ast/blob/master/grammar-kotlin-parser-antlr-java/src/test/kotlin/kotlinx/ast/example/ExampleMain.kt
But sadly, it seems that antlr-kotlin
is not much slower than antlr-java
. I will try to figure out how to speed up parsing.
from ast.
@ShikaSD pointed me to antlr-optimized, so I implemented support for this antlr fork in kotlinx.ast
. But sadly, it is not as fast as hoped.
I will try to implement a lexer and parser using antlr4 grammar files, only supporting the features that are required to parse kotlin files.
I already added support to parse antlr4 grammar files for this use case in kotlinx.ast:grammar-antlr4-parser-antlr-java
.
from ast.
The time for ./gradlew clean check
was reduced from 3min 30s in commit c7dd6bb to 2min 30s in commit f088b3c.
because of this, all kotlin files will now be scanned in the self test.
it is still required to speed this up, I think we need some patch to the kotlin parser/lexer for this.
from ast.
build time for commit 95db180 is 44s, so we can assume that testing the previusly excluded files takes around 1 minute 45s.
- KotlinLexer.kt
- KotlinParser.kt
- UnicodeClasses.kt
from ast.
Can you have a look at my comment in #50 ? Why is a large garbage-string faster than a large string containing json?
from ast.
Related Issues (20)
- Add a grammar for Kotlin Script
- org.antlr.v4.kotlinruntime.atn.ATNConfig object has a large number of instance counts, OOM
- Need "kts" scripts support
- incorrect breakline parsing HOT 1
- AST Node Tree Refactoring / Insertion / Removal
- Is that the BlockComment node would be parsed?
- I am really confused, which dependency should be used? HOT 5
- End-of-line comments not available in summary HOT 2
- Property delegate not available in summary HOT 2
- Argument with unary prefix is incomplete in summary AST HOT 2
- Best way to add new keywords like in the Spock test HOT 4
- Can I get the specified method code block HOT 3
- Record syntax error messages
- Why column is called row?
- Unsupported ast node functionType when function type used as generic type
- Publish somewhere different than jitpack.io HOT 10
- Is it possible to insert an element? HOT 2
- Add support for @JvmSuppressWildcards/ Annotations for types. HOT 4
- How can I get the specified method code block!Looking forward to answer
- How do I rely on this project on Maven? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ast.