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
/vuePublic

perf(server-renderer):normalizeValue function prioritizes the judgmen…#13054

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

Open
LockingReal wants to merge1 commit intovuejs:main
base:main
Choose a base branch
Loading
fromLockingReal:perf-server-renderer-normalizevalue

Conversation

LockingReal
Copy link

…t of values equal to 0, thereby improving performance

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • [√] Other, please describe:

Does this PR introduce a breaking change? (check one)
When the value is equal to 0, it avoids two typeof judgments and one js object attribute value, which improves performance

  • Yes
  • [√] No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding anew feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

…t of values equal to 0, thereby improving performance
@LockingReal
Copy link
Author

I have already run thenpm run test command locally and passed all of it

@LockingReal
Copy link
Author

LockingReal commentedJul 22, 2023
edited
Loading

@sxzz@antfu@sodatea Can you help me check it ~~🥰

@haoqunjiang
Copy link
Member

Not now.

While I appreciate your contribution to the project, please don't @ me unless it's urgent.
Just like you shouldn't call your colleague to review a small refactor on a Sunday morning. It's insensitive and impolite, to say the least.

sxzz and Justineo reacted with thumbs up emoji

@LockingReal
Copy link
Author

Not now.

While I appreciate your contribution to the project, please don't @ me unless it's urgent. Just like you shouldn't call your colleague to review a small refactor on a Sunday morning. It's insensitive and impolite, to say the least.

I think this is an open source project, and people will not treat it like work. The pressure in this area should not be too great, and I really didn't think too much. I'm very sorry 😢😣🤕

@LockingReal
Copy link
Author

@Justineo I see in the PR list that you have participated in some Code review work in some items on the first page of PR. Can you help check it?thanks~❤️

@Justineo
Copy link
Member

I don’t get it how is this improving performance?

P.S. Don’t tag people like this unless it’s urgent. It is impolite as soda pointed out to you.

@LockingReal
Copy link
Author

LockingReal commentedJul 24, 2023
edited
Loading

I don’t get it how is this improving performance?

P.S. Don’t tag people like this unless it’s urgent. It is impolite as soda pointed out to you.

With the current modification, when value is equal to 0, an unnecessary typeof value=='string 'judgment will be skipped, and a typeof value==='number'&&noUnitNumericStyleProps [key] judgment will be skipped to directly enter the subsequent logic.

from the perspective of performance, using the === operator for equality comparison is faster than using the typeof operator for type checking.

the === operator only needs to compare if two values are exactly equal, while the typeof operator needs to check the type of the value, which may require more operations. Additionally, typeof also needs to perform string comparisons, which can lead to more time consumption.

@LockingReal
Copy link
Author

I don’t get it how is this improving performance?

P.S. Don’t tag people like this unless it’s urgent. It is impolite as soda pointed out to you.

In fact, I don't know how to find someone to review. Do we have a similar schedule? Do we regularly check them(pr)? I don't have much experience in cooperating with our project 🤕

@Justineo
Copy link
Member

It’s faster only whenvalue is0.

LockingReal reacted with laugh emoji

@Justineo
Copy link
Member

In fact, I don't know how to find someone to review. Do we have a similar schedule? Do we regularly check them(pr)? I don't have much experience in cooperating with our project 🤕

You don’t need to actively find someone to review a minor refactor. Project members may review PRs anytime they feel comfortable with.

LockingReal and alivadjid reacted with heart emoji

@LockingReal
Copy link
Author

LockingReal commentedJul 24, 2023
edited
Loading

其实我也不知道怎么找人审稿。我们有类似的时间表吗?我们定期检查它们吗(pr)?我没有太多合作我们项目的经验🤕

你不需要主动找人来审查一个小的重构。项目成员可以在他们觉得舒服的时候随时审查 PR。

Haha, actually I used to do that in other projects, nothing happen...but I current understand. Thank you for your guidance~🥰

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@LockingReal@haoqunjiang@Justineo

[8]ページ先頭

©2009-2025 Movatter.jp