Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove unnecessary realpath calls from host probing logic#50671

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mateoatr merged 23 commits intodotnet:mainfrommateoatr:apphostBehindSymlink
Apr 15, 2021

Conversation

@mateoatr
Copy link
Contributor

In an effort to improve startup time, this PR gets rid of three different file-accessing calls inside the host:

if (pal::file_exists(additional_deps_path))

Which performs a file existence check on each of the assets inside a deps.json.

And:

pal::realpath(&real_asset_path);

Which purpose is to unroll the symbolic link of a given path and, in the later case, to later normalize the path.

stephentoub and agocke reacted with heart emoji
@ghostghost added the area-Host labelApr 3, 2021
@ghost
Copy link

Tagging subscribers to this area:@vitek-karas,@agocke,@VSadov
See info inarea-owners.md if you want to be subscribed.

Issue Details

In an effort to improve startup time, this PR gets rid of three different file-accessing calls inside the host:

if (pal::file_exists(additional_deps_path))

Which performs a file existence check on each of the assets inside a deps.json.

And:

pal::realpath(&real_asset_path);

Which purpose is to unroll the symbolic link of a given path and, in the later case, to later normalize the path.

Author:mateoatr
Assignees:-
Labels:

area-Host

Milestone:-

Copy link
Member

@vitek-karasvitek-karas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Basically just some more interesting test cases, otherwise looks good.

Comment on lines 174 to 178
if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// Set code page to output unicode characters.
Command.Create("chcp 65001").Execute();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This test is disabled no Windows as per above if - maybe just leave a comment, that enabling this on Windows will require running this command.

else
{
trace::verbose(_X(" %s path query exists %s"), query_type, candidate.c_str());
trace::verbose(_X(" %s path query %s"), query_type, candidate.c_str());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nit - maybe include(skipped existence check) or something like that, so that it's easy to determine what happened (I know the strings are different already, but they're very similar).

Comment on lines +223 to +224
StandaloneAppFixture_Localized=localizedFixture;
StandaloneAppFixture_Published=publishFixture;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Couple more tests we might want to add:

  • Framework dependent app - run it from a symlink
  • Framework dependent app where runtime install location is a symlink (basicallyDOTNET_ROOT points to a symlink)
  • Running an app viadotnet app.dll where thedotnet is a symlink. (I think this is close to the snap scenario)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Some more

  • Make sure we have a test to validate additional probing paths (that they continue to work even after this change)

mateoatr reacted with thumbs up emoji

// Given a "base" dir, yield the file path within this directory or single-file bundle.
boolto_dir_path(constpal::string_t&base,boollook_in_bundle,pal::string_t*str,bool&found_in_bundle)const;
boolto_dir_path(constpal::string_t&base,boollook_in_bundle,pal::string_t*str,bool&found_in_bundle,boolcheck_file_existence)const;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Would strongly recommend keeping the last parameter as the out. In this case we now have "in in out out in". Also, we now have two booleans in these cases which means we are close to warranting an enumeration. At the very least though all of these functions should be updated to keep the outs as the last parameters.

mateoatr reacted with thumbs up emoji
@mateoatrmateoatr marked this pull request as ready for reviewApril 15, 2021 18:53
@mateoatrmateoatr merged commitfa49dbc intodotnet:mainApr 15, 2021
@ghostghost locked asresolvedand limited conversation to collaboratorsMay 16, 2021
@karelzkarelz added this to the6.0.0 milestoneMay 20, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@AaronRobinsonMSFTAaronRobinsonMSFTAaronRobinsonMSFT left review comments

@brianrobbrianrobbrianrob approved these changes

@vitek-karasvitek-karasvitek-karas approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

6.0.0

Development

Successfully merging this pull request may close these issues.

5 participants

@mateoatr@brianrob@vitek-karas@AaronRobinsonMSFT@karelz

[8]ページ先頭

©2009-2025 Movatter.jp