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

feat: restore xml parsing to avoid postgis request #89

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

jmkerloch
Copy link
Collaborator

Even with the use of flags QgsProject.FlagDontResolveLayers | QgsProject.FlagDontLoadLayouts | QgsProject.FlagTrustLayerMetadata | QgsProject.FlagDontStoreOriginalStyles we still see some request to postgis if there are postgis layer in the project.

If the number of layer is big this really increase project load time.

To avoid that this PR restore the use of xml parsing for project menu configuration definition.

  • A new class QgsDomManager is created to store all the loaded xml projects (was previously in plugin main):
    • This allow us to use this class in other part of plugin that the plugin main.
  • Full refactoring of project_read.py to use xml parsing.

@xcaeag xcaeag merged commit 5a68885 into aeag:master Sep 26, 2024
1 check passed
@Guts
Copy link
Collaborator

Guts commented Sep 26, 2024

@xcaeag woa so fast! Did you really review it before? I had not time to set up my local test environment!

@xcaeag
Copy link
Collaborator

xcaeag commented Sep 26, 2024

not familiar with reviews. I trust, I integrate, I test then!

@jmkerloch
Copy link
Collaborator Author

@xcaeag Wasn't expecting a merge this quick !

If anything turns out to be wrong I will quickly do a fix.

@jmkerloch jmkerloch deleted the feat-restore-xml-parsing branch September 26, 2024 13:24
@xcaeag
Copy link
Collaborator

xcaeag commented Sep 26, 2024

well, it rocks!
tests passed on different test menus:

all loaded in.. 2s

@Guts
Copy link
Collaborator

Guts commented Nov 14, 2024

@jmkerloch can you remember me the related issue upstream on QGIS project please?

@jmkerloch
Copy link
Collaborator Author

@jmkerloch can you remember me the related issue upstream on QGIS project please?

I created an issue about layer notes that should be corrected in master : qgis/QGIS#58818

But if we wan't to be as fast as xml parsing there are other optimization needed in Qgis core.

@Guts
Copy link
Collaborator

Guts commented Nov 14, 2024

But if we wan't to be as fast as xml parsing there are other optimization needed in Qgis core.

Can you develop a bit please?

@Guts
Copy link
Collaborator

Guts commented Nov 14, 2024

I created an issue about layer notes that should be corrected in master : qgis/QGIS#58818

It has been backported to 3.34.

@jmkerloch
Copy link
Collaborator Author

But if we wan't to be as fast as xml parsing there are other optimization needed in Qgis core.

Can you develop a bit please?

I need to do some tests but this wasn't as fast as xml parsing. I remember for instance query to database in case of postgis layer.

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

Successfully merging this pull request may close these issues.

3 participants