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

Change project style disabling from being a project load flag to a new project "capability" #49266

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

nyalldawson
Copy link
Collaborator

This avoids the unwanted cost of initialising a blank style database
whenever QgsProject::clear is called and project styles are not
required (eg. for server)

Hopefully fixes regression in server project load times

@github-actions github-actions bot added this to the 3.28.0 milestone Jul 7, 2022
@nyalldawson
Copy link
Collaborator Author

Ping @dmarteau -- can you test if this fixes your server performance regression please?

@rldhont
Copy link
Contributor

rldhont commented Jul 7, 2022

Thanks @nyalldawson

@dmarteau will test it

@dmarteau
Copy link
Contributor

dmarteau commented Jul 7, 2022

Hi, thx for the fix,

I'm trying to test the branch but I cannot figure how to pass '0' in python as capabilities value. I'm stuck with the error TypeError: QgsProject(): argument 'capabilities' has unexpected type 'int' if I try to execute QgsProject(capabilities=0)

@nyalldawson
Copy link
Collaborator Author

@dmarteau use the flags constructor

capabilities=Qgis.ProjectCapabilities()

@nyalldawson nyalldawson closed this Jul 7, 2022
@nyalldawson nyalldawson reopened this Jul 7, 2022
@dmarteau
Copy link
Contributor

dmarteau commented Jul 8, 2022

@nyalldawson Tests are now ok,

From simple loading test I benchmarked approx 200ms for initialising QgsProject() the default flags and aroud 19ms with QgsProject(capabilities=Qgis.ProjectCapabilities()).

Benchmarks on other server tests have improved with the same ratio.

Thanks for the job !

to a new project "capability"

This avoids the unwanted cost of initialising a blank style database
whenever QgsProject::clear is called and project styles are not
required (eg. for server)
@nyalldawson nyalldawson merged commit 9b09445 into qgis:master Jul 11, 2022
@nyalldawson nyalldawson deleted the style_disable branch July 11, 2022 05:22
@qgis-bot
Copy link
Collaborator

The backport to release-3_26 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply fa7d424e69... Change project style disabling from being a project load flag
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

stdout
Auto-merging python/core/auto_additions/qgis.py
CONFLICT (content): Merge conflict in python/core/auto_additions/qgis.py
Auto-merging python/core/auto_generated/qgis.sip.in
CONFLICT (content): Merge conflict in python/core/auto_generated/qgis.sip.in
Auto-merging src/app/browser/qgsinbuiltdataitemproviders.cpp
Auto-merging src/core/qgis.h
CONFLICT (content): Merge conflict in src/core/qgis.h

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_26 release-3_26
# Navigate to the new working tree
cd .worktrees/backport-release-3_26
# Create a new branch
git switch --create backport-49266-to-release-3_26
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick fa7d424e692de536426caf719591692bb9ab769f
# Push it to GitHub
git push --set-upstream origin backport-49266-to-release-3_26
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_26

Then, create a pull request where the base branch is release-3_26 and the compare/head branch is backport-49266-to-release-3_26.

@qgis-bot qgis-bot added the failed backport The automated backport attempt failed, needs a manual backport label Jul 11, 2022
dmarteau added a commit to 3liz/py-qgis-server that referenced this pull request Jul 21, 2022
dmarteau added a commit to 3liz/py-qgis-server that referenced this pull request Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed backport The automated backport attempt failed, needs a manual backport
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants