mybatis / mybatipse

Eclipse plugin adding support for MyBatis SQL Mapper Framework.
Eclipse Public License 1.0
332 stars 91 forks source link

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

Open Shiaming opened 1 year ago

Shiaming commented 1 year ago

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

Shiaming commented 1 year ago

The mybatipse version is the latest

Shiaming commented 1 year ago

The mybatipse version is the latest

MyBatipse 1.3.0.202210300418

harawata commented 1 year ago

It takes 5 seconds to do "what" exactly?

Shiaming commented 1 year ago

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 commented 1 year ago

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

Shiaming commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

Could you try disabling validation?

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

Shiaming commented 1 year ago

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 commented 1 year ago

Thank you for your attention to this issue

harawata commented 1 year ago

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 commented 1 year ago

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

Shiaming commented 1 year ago

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

harawata commented 1 year ago

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 commented 1 year ago

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

hazendaz commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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!