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

IsBackOfficeRequest is extremely inefficient #13732

Closed
Nuklon opened this issue Jan 25, 2023 · 6 comments · Fixed by #13743
Closed

IsBackOfficeRequest is extremely inefficient #13732

Nuklon opened this issue Jan 25, 2023 · 6 comments · Fixed by #13743

Comments

@Nuklon
Copy link
Contributor

Nuklon commented Jan 25, 2023

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

v9, v10, v11

Bug summary

https://github.com/umbraco/Umbraco-CMS/blob/v11/contrib/src/Umbraco.Core/Routing/UmbracoRequestPaths.cs

This gets called a lot and does a lot of unnecessary things.

  • It can optionally take the Path property from a Request instead of trimming the entire URL.
  • _defaultUmbPaths is useless, this can just be a string.
  • urlPath gets split by forward slash for PluginController, while this should just count slashes and avoid unnecessary allocations.

Created originally as a discussion here #11640 but this seems completely ignored.

Specifics

No response

Steps to reproduce

Just run Umbraco.

Expected result / actual result

Should be optimized.

@github-actions
Copy link

Hi there @Nuklon!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@Zeegaan
Copy link
Member

Zeegaan commented Jan 25, 2023

Hey @Nuklon, I agree it is inefficient, as you've already pointed out some good places to improve I will mark this as up for grabs, as we'd love some help with this 🙌

@github-actions
Copy link

Hi @Nuklon,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post.

Thanks muchly, from your friendly Umbraco GitHub bot :-)

@Nuklon
Copy link
Contributor Author

Nuklon commented Jan 25, 2023

Hey @Nuklon, I agree it is inefficient, as you've already pointed out some good places to improve I will mark this as up for grabs, as we'd love some help with this 🙌

I had already created a PR for v9 but nothing happened with it. I can recreate for v11 if wanted...

@Zeegaan
Copy link
Member

Zeegaan commented Jan 26, 2023

@Nuklon Yep we would love that 🙌

@Nuklon
Copy link
Contributor Author

Nuklon commented Jan 26, 2023

@Nuklon Yep we would love that 🙌

Great!
#13743

mikecp added a commit that referenced this issue Feb 16, 2023
* Update UmbracoRequestPaths.cs

* Update UmbracoRequestPaths.cs

* remove redundant check

---------

Co-authored-by: Michael <michael@crossingpaths.be>
nul800sebastiaan pushed a commit that referenced this issue Mar 21, 2023
* Update UmbracoRequestPaths.cs

* Update UmbracoRequestPaths.cs

* remove redundant check

---------

Co-authored-by: Michael <michael@crossingpaths.be>
(cherry picked from commit de27eb6)

# Conflicts:
#	src/Umbraco.Core/Routing/UmbracoRequestPaths.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants