-
Notifications
You must be signed in to change notification settings - Fork 2
Merge from latest antlr #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… flowcontrol - 50% performance improvement
- Prior to this change, a recognition error was tracked by performing a panic(),
which the generated code for rules would then use recover() to discover. However,
recover() is not like catch(){} in Java and is expensive to run even if there is
no panic() to find on the execution stack. Eliminating this and doing a simple check
at the end of rule execution brings with it a massive performance improvement up to
50% of CPU execution time. Now that collections and context caching is working correctly
this is a significant improvement in execution time.
Signed-off-by: Jim.Idle <jimi@idle.ws>
Prior to this change, the runtime and generated code was using panic() and recover() to perform error checking and reporting. This is extremely expensive and just not the way to do it. This change now uses goto, and explicit checking for error state after selected calls into the runtime. This has greatly improved parser performance. Using the test code provided by a recent performance issue report, the parse is now twoice as fast as the issue raised was hoping for. Signed-off-by: Jim.Idle <jimi@idle.ws>
* Add missing methods typing Signed-off-by: hdpnguyen <hieu.dac.phuong.nguyen@mgm-tp.com> * Fix PR comments Signed-off-by: hdpnguyen <hieu.dac.phuong.nguyen@mgm-tp.com> --------- Signed-off-by: hdpnguyen <hieu.dac.phuong.nguyen@mgm-tp.com> Co-authored-by: hdpnguyen <hieu.dac.phuong.nguyen@mgm-tp.com> Signed-off-by: Jim.Idle <jimi@idle.ws>
* do not modify String.prototype in js package Signed-off-by: Jon Harris <harris.jb@gmail.com> * remove notice file that is no longer relevant Signed-off-by: Jon Harris <harris.jb@gmail.com> --------- Signed-off-by: Jon Harris <harris.jb@gmail.com> Signed-off-by: Jim.Idle <jimi@idle.ws>
Github action for upload was upgraded to v3 recently and the release is unstable causing too many uploads to fail. Downgrading back to previous version hasn't made significant improvement either. Since the artifacts aren't exactly used by any chained job, failures for uploading the artifact can be ignored. The artifacts are used mostly for the purpose for debugging and so if needed the user can trigger specific build again to get the artifact. Signed-off-by: HS <hs@apotell.com> Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Jim.Idle <jimi@idle.ws>
Interfaces require two pointer lookups for functions and when used as Generic, they require three. This change therefore yields a small performance upgrade. This change also corrects one or two copmarisons that were using pointer comparison instead of Equals() and were bugs in the code I inherited. Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Jim.Idle <jimi@idle.ws>
…lace Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Jim.Idle <jimi@idle.ws>
… a single type and therefore a pointer Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Jim.Idle <jimi@idle.ws>
Too much emulation of the Java runtime structure means that many structs are being called via interfaces, which introduces and extra look up. When you add that lookup to call via a pointer and then even an extra lookup for generics, then it becomes significant. This seems like a big commit but it is all just changing the one type declaration. This now allows us to get rid of the stupid getters and setters that just clutter the code and are not idiomatic of Go anyway. Signed-off-by: Jim.Idle <jimi@idle.ws>
Go does not use Getters and Setters unless there is some very good reason such as copy on read or write. They can stop the compiler from inlining things so they are now gone from ANTConfigSet, whihc is no longer an interface. Signed-off-by: Jim.Idle <jimi@idle.ws>
Like other struct implementations, this was hidden by an interface that did not need to be there. the only difference between a lexer and parser config is the Hash/Equals and extra methods that only the lexer calls. Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Jim.Idle <jimi@idle.ws>
…f DFA collections Signed-off-by: Jim.Idle <jimi@idle.ws>
Also corrects the formatting of some of the files as this can create false compares in git. Signed-off-by: Jim.Idle <jimi@idle.ws>
…er look Signed-off-by: Jim.Idle <jimi@idle.ws>
…in some cases Signed-off-by: Jim.Idle <jimi@idle.ws>
…each run Signed-off-by: Jim.Idle <jimi@idle.ws>
Another small gain, but for one good parser this goes from 90ms to 64ms (for 16 large files) so it won't make a lot of difference for poor parser, but good ones will see a nice kick here Signed-off-by: Jim.Idle <jimi@idle.ws>
o Uses reflection to check that the tree structure is all correct o Disables test that uses superClass as this basically doesn't work/isn't a concept in Go. Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Ahmad Tameem <ahmad.tameem97@gmail.com>
Signed-off-by: Adrian Jutrowski <adrian.jutrowski@gmail.com>
…mpacted Signed-off-by: Adrian Jutrowski <adrian.jutrowski@gmail.com>
Signed-off-by: cyqw <cyqw@163.com>
Signed-off-by: cyqw <cyqw@163.com>
Signed-off-by: cyqw <cyqw@163.com>
Signed-off-by: cyqw <cyqw@163.com>
|
@cyqw care to fix the conflict? Should be straight forward. I'll look into merging this PR this week! |
| @@ -22,7 +22,7 @@ fn main() { | |||
| None, | |||
| None, | |||
| ]; | |||
| let antlr_path = "../antlr4/tool/target/antlr4-4.8-2-SNAPSHOT-complete.jar"; | |||
| let antlr_path = "../../../tool/target/antlr4-4.13.3-SNAPSHOT-complete.jar"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏 Thanks! Looks like I had these (relative dir) changes only local still 🤦
|
@cyqw also, I'll check it all out locally, but I'm somewhat confused by the |
|
|
@cyqw Ah! Yes... all that java code that uses |
Signed-off-by: cyqw <cyqw@163.com>
Signed-off-by: cyqw <cyqw@163.com>
|
@alexsnaps |
|
I'm really sorry @cyqw - there were some a few advisories (as you may have inferred from the work that happened) raised in cel-rust that are now mitigated. But sadly recreates conflicts for this branch (now they shouldn't matter, and be straight resolves). With that being said tho, if you get to resolve these and update this branch, then great, if you can't... I'll give it a shot later this week. But once that is done, I can try your changes out and hopefully merge this week. Again, sorry about this, but you can imagine these issues were more important to be addressed asap. |
|
Also, I might have been unclear, but feel free to keep the alignment with java to |
…st-target Signed-off-by: cyqw <cyqw@163.com>
Resolved the conflict |
|
What am I doing wrong here: Works fine (on my machine 🤦 ) on |
|
This plugin invoke a static method "getProperties" in UnicodeDataTemplateController.java |
|
Ok, well I get that... but, wait... is your PR here WIP or ... working? |
|
Hmm... But can you please let me know what you think this PR achieves? |
|
For some reason my environment was in bad state. That looks really promising! I'll look into merging this if not today, tomorrow... But again, what do you think is the state of this PR? |
I think this PR is ready to merge. |
|
This PR rebase with dev branch of antlr4, it use github actions to run CI on branch master dev. action |
|
Merging this, let's add |
All antlr's target use same testcases in runtime-testsuite\resources\org\antlr\v4\test\runtime\descriptors.
provide rust runtime test runner for latest antlr.
#2