Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Consider not using Path.GetDirectoryName in ViewStartUtility #2009

Closed
pranavkm opened this issue Feb 12, 2015 · 2 comments
Closed

Consider not using Path.GetDirectoryName in ViewStartUtility #2009

pranavkm opened this issue Feb 12, 2015 · 2 comments

Comments

@pranavkm
Copy link
Contributor

Today given an app relative path, we use Path.GetDirectoryName to determine potential paths for _ViewStart.cshtml. Path.GetDirectoryName does a bunch of operations to figure out if the path is absolute and sanitizing which shows up in perf profiles. Additionally, it attempts to normalize the directory separator

var path = Path.GetDirectoryName("foo/bar/baz"); // foo\bar

Since these paths are generated from the Razor view engines, an option would be to consider simply substring-ing the passed in path rather than using Path.GetDirectoryName. Some discussion about this is available at #1996 (comment)

@danroth27 danroth27 added this to the 6.0.0 milestone Feb 16, 2015
@danroth27 danroth27 modified the milestones: Backlog, 6.0.0-beta5, 6.0.0-beta6 May 11, 2015
@Eilon Eilon modified the milestones: 6.0.0-beta6, 6.0.0-beta7 Jun 29, 2015
@Eilon Eilon modified the milestones: 6.0.0-beta7, 6.0.0-beta8 Aug 5, 2015
@Eilon Eilon modified the milestones: 6.0.0-beta8, 6.0.0-rc1 Sep 24, 2015
@Eilon Eilon modified the milestones: 6.0.0-rc1, 1.0.0-rc2 Oct 22, 2015
@rynowak
Copy link
Member

rynowak commented Nov 5, 2015

This bug isn't relevant anymore, we've already decided to cache all of this data as part of the changes in #3364. After that PR is checked in, we'll profile and identify any new issues that crop up.

Closing as this is not actionable anymore.

@rynowak rynowak closed this as completed Nov 5, 2015
@rynowak rynowak added invalid and removed 1 - Ready labels Nov 5, 2015
@rynowak rynowak removed their assignment Nov 5, 2015
@pranavkm
Copy link
Contributor Author

pranavkm commented Nov 5, 2015

We actually fixed this as part of #3294. Closing this as dup

@pranavkm pranavkm added duplicate and removed invalid labels Nov 5, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants