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

Remove some control spacers from editor. #80578

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WhalesState
Copy link
Contributor

this fixes: #80577

@WhalesState WhalesState requested review from a team as code owners August 13, 2023 04:13
@WhalesState
Copy link
Contributor Author

lot's of files have been changed, while I already have tested most of them here https://github.com/WhalesState/pixel-engine but this will need more testing to insure that nothing have changed, also the 3d plugins are untouched yet.

@WhalesState
Copy link
Contributor Author

I also have added this to BoxContainer to prevent the spacer from empty fill which may make the CanvasItem's shader process the empty pixels all the time.
image

@MewPurPur
Copy link
Contributor

Why?

@WhalesState
Copy link
Contributor Author

Why?

because this happened after removing them.
image

@WhalesState
Copy link
Contributor Author

https://github.com/godotengine/godot/actions/runs/5845316423 you can compare this with any other build that was produced on github.

@MewPurPur
Copy link
Contributor

MewPurPur commented Aug 13, 2023

So the reason is that spacers are taxing on performance? This is a good find, but I think even now, most people will prefer spacers with slightly worse performance, over no spacers and slightly better performance. Spacers are important to improve the appearance of Godot and help with visual grepping. To me this looks more like a reason to look into optimizing spacers or StyleBoxLine instead.

(edit: I confused spacers and separators, but pretty much the point holds)

@WhalesState
Copy link
Contributor Author

WhalesState commented Aug 13, 2023

i already have made another comparison with the 4.2 dev editor build and this action editor build https://github.com/godotengine/godot/actions/runs/5845316423, and again this happens, you can explain it better than me.
image

@WhalesState
Copy link
Contributor Author

So the reason is that spacers are taxing on performance? This is a good find, but I think even now, most people will prefer spacers with slightly worse performance, over no spacers and slightly better performance. Spacers are important to improve the appearance of Godot and help with visual grepping. To me this looks more like a reason to look into optimizing spacers or StyleBoxLine instead.

the control spacers do a job that the control size flags do, so simply instead of using a spacer you can use size flags like this.

image

@AThousandShips
Copy link
Member

Are those comparisons of two identical build setups, or is one the artifact and one the default published build?

@WhalesState
Copy link
Contributor Author

WhalesState commented Aug 13, 2023

Are those comparisons of two identical build setups, or is one the artifact and one the default published build?

one is the recent 4.2.dev official release and the other one from this github actions artifacts https://github.com/godotengine/godot/actions/runs/5845316423. do you still think i was wasting my time ?

I'm just running the same project.

image

@AThousandShips
Copy link
Member

And you are running windows?

@WhalesState
Copy link
Contributor Author

And you are running windows?

yes, Windows 10 home latest release and everything is up to date.

@AThousandShips
Copy link
Member

AThousandShips commented Aug 13, 2023

They are not equivalent builds, compare with https://github.com/godotengine/godot/actions/runs/5830575651 for example

I ran your latest changes, and there's no reduction in RAM at all, in fact it is about 40 MB higher for the equivalent context, though I am not doing repeatable testing, but no massive reduction

Further, a number of controls now look much less clean and more stretched out, compare before and after for connect for example, which just shows the reason we do use spacers and why they can't just be ignored:
Before:

image

After:

image

@WhalesState
Copy link
Contributor Author

try to run the game with editor in both and this may happen.

image

the stretch is because BoxContainer is adding separation between every 2 control nodes. i don't remember the default value but maybe 4 pixels,
image

@AThousandShips
Copy link
Member

AThousandShips commented Aug 13, 2023

So in order to get the performance boost you have to have the engine running a game instance, then you don't think that's what is relevant there? Not the spacers? Probably caused by shared data between the two instances since they run the same data

In fact, does the process memory for the one process increase when you run the second instance?

I.e. does the one with 624 MB drop if you exit the one running from the 173 MB one

@WhalesState WhalesState marked this pull request as ready for review September 10, 2024 10:03
@WhalesState WhalesState requested review from a team as code owners September 10, 2024 10:03
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

I'm still not really convinced about usefulness of this change, but I guess it can pass as code cleanup. Proper size flags are equivalent of spacers and do not change anything visually, so it's fine.

Needs rebase.

@WhalesState
Copy link
Contributor Author

Yes, just a small cleanup, since spacers are usefull but we should not overuse them.
I will do another check later to find other spacers that can be safely removed.

@WhalesState
Copy link
Contributor Author

Can you tell me how you all do rebase ? 😆

@WhalesState WhalesState marked this pull request as draft September 13, 2024 22:49
@WhalesState
Copy link
Contributor Author

This is the first time to do the rebase correctly, but it didn't include the new changes since i was rebasing from my master branch while i already have updated it, so now i know i should rebase from the godotengine/godot master branch instead.

@WhalesState WhalesState marked this pull request as ready for review September 13, 2024 23:01
@KoBeWi KoBeWi removed request for a team September 13, 2024 23:15
@WhalesState WhalesState marked this pull request as draft October 18, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Control Spacers from editor and dialogs
7 participants