Skip to content
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

When the file is too big, it often takes 5 seconds or more #115

Open
Shiaming opened this issue Mar 21, 2023 · 20 comments
Open

When the file is too big, it often takes 5 seconds or more #115

Shiaming opened this issue Mar 21, 2023 · 20 comments

Comments

@Shiaming
Copy link

Such as userMapper.java include 100 statement links to userMapper.xml are always stuck
It may also cause the eclipse to become unresponsive

@Shiaming
Copy link
Author

The mybatipse version is the latest

@Shiaming
Copy link
Author

The mybatipse version is the latest

MyBatipse 1.3.0.202210300418

@harawata
Copy link
Member

It takes 5 seconds to do "what" exactly?

@Shiaming
Copy link
Author

It takes 5 seconds to do "what" exactly?

Take 5 seconds to open the userMapper.xml that matches the sql statement
and then the eclipse is not responding during this time

@harawata
Copy link
Member

If you open the "userMapper.xml" from the "Package Explorer" or "Project Explorer", it does not take 5 seconds?

@Shiaming
Copy link
Author

If you open the "userMapper.xml" from the "Package Explorer" or "Project Explorer", it does not take 5 seconds?

The same as above
If I uninstall the plug-in and use Package Explorer open the userMapper.xml is quick

@harawata
Copy link
Member

@Shiaming ,

I added 100 statements to a XML mapper, but it does not reproduce the issue, so there may be another reason.
I would be happy to investigate, but I need to reproduce the issue to do that.
Please create a project with minimum setup to reproduce the problem.
And share the project on your GitHub repository.

Thank you!

@Shiaming
Copy link
Author

Shiaming commented Mar 22, 2023

@Shiaming ,

I added 100 statements to a XML mapper, but it does not reproduce the issue, so there may be another reason. I would be happy to investigate, but I need to reproduce the issue to do that. Please create a project with minimum setup to reproduce the problem. And share the project on your GitHub repository.

Thank you!

Because my project is complex and not very good to simulate the scene
Can I enable the plugin log printing function?
I found the following configuration file
The location of the configuration file is here
net.harawata.mybatipse_1.3.0.202210300418.jar
.options
Enable verbose logging.
net.harawata.mybatipse/debug=true
Bean property cache activities.
net.harawata.mybatipse/debug/beanPropertyCache=false
But I don't know how to configure in the eclipse

@harawata
Copy link
Member

Then you may have to debug the plugin yourself.
Logging in this plugin is mainly for errors, so it probably is not helpful very much.

p.s.
I must say that 100 statements in a single mapper is quite unusual.
The best practice is to create one mapper for one DB table.
See this Q&A : https://stackoverflow.com/a/75603479/1261766

@harawata
Copy link
Member

Could you try disabling validation?

  • From the menu, open "Project" > "Properties"
  • Select "Validation" and check "Enable project specific settings"
  • Check-off "Manual" and "Build" of "MyBatis XML Mapper Validator"

Validation does not run just by opening the file, usually.
But if another tool triggers the build, it might run.

@Shiaming
Copy link
Author

The above method still does not solve it well.
I had to disable this feature to do so.
Select "General->Editors->Text Editors Hyperlinking" and disable "Mybatis Java Mapper Hyperlink Detector"
That's the best compromise I can think of.
Search mapper stattements can replace it with Quick Search.

@Shiaming
Copy link
Author

Thank you for your attention to this issue

@harawata
Copy link
Member

Thank you for the info!

I think that hyperlink detection is activated only when you press control key (or command key on macOS) and move the mouse pointer on the editor.
In other words, it is not activated just by opening the XML editor, with the default settings at least.

Do you have any custom configuration or a plugin that somehow triggers hyperlink detection automatically?

@Shiaming
Copy link
Author

You may misunderstand my meaning. what I meant was that opening this hyperlink led to unresponsive

@Shiaming
Copy link
Author

The development tools I use are "Spring Tool Suite 4 Version: 4.10.0.RELEASE" .

@harawata
Copy link
Member

Oh, OK.
Just to clarify, it happens when you click a hyperlink ...

  1. in a Java mapper to open XML mapper
  2. in a XML mapper to open Java mapper

Which is it?
Or, is it both?

@Shiaming
Copy link
Author

Both are slow, but "in a Java mapper to open XML mapper" is even slower.

@hazendaz
Copy link
Member

Seems like you are using really old spring. Can you upgrade to 4.18? Maybe newer eclipse possible as well as likely pretty old given spring revision? A lot has changed with Eclipse in last year...

@Shiaming
Copy link
Author

Seems like you are using really old spring. Can you upgrade to 4.18? Maybe newer eclipse possible as well as likely pretty old given spring revision? A lot has changed with Eclipse in last year...

I can try it.

@Shiaming
Copy link
Author

Seems like you are using really old spring. Can you upgrade to 4.18? Maybe newer eclipse possible as well as likely pretty old given spring revision? A lot has changed with Eclipse in last year...

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants