Skip to content

[1.16.1] Apply advancements async#4057

Closed
Proximyst wants to merge 1 commit into
PaperMC:masterfrom
Proximyst:async-advancements-3
Closed

[1.16.1] Apply advancements async#4057
Proximyst wants to merge 1 commit into
PaperMC:masterfrom
Proximyst:async-advancements-3

Conversation

@Proximyst
Copy link
Copy Markdown
Contributor

Asynchronous advancements, take 3.

Advancements are loaded in the same way as before, except asynchronously.
This uses the approach from take 1 (#3454), except with the notes from Aikar
taken into account.

A player with all advancements took an estimated 15-30ms or so every login
on my own machine. The first login of which always took well over 200ms,
hanging around at about 300ms. I'll take the stance that this change will
provide favourable performance alleviations for servers.

I've again taken the approach of a "get if loaded" method in certain cases,
mostly just those which save data. This should lead to corrupt data or simply
not yet loaded data not being saved which results in no data loss and no
waiting for the loading to finish.

@tofipix
Copy link
Copy Markdown
Contributor

tofipix commented Aug 4, 2020

Why isn't async advancements setting turned on by default? , because in my opinion it should

@MrIvanPlays
Copy link
Copy Markdown
Contributor

Why isn't async advancements setting turned on by default?

Because by default every setting should replicate vanilla behavior (or shouldn't, but that's how it is in upstream projects so paper follows) and as this is not vanilla's default behavior in order to get it we disable it by default.

@Proximyst
Copy link
Copy Markdown
Contributor Author

Because by default every setting should replicate vanilla behavior

No. Default settings in Paper are what people would most likely prefer.

Why isn't async advancements setting turned on by default?

Because I just typed out the setting while not really thinking over defaults.
I'm all for moving it to default on, but I'd like to hear if anyone else agrees
to that first. (Feel free to 👍 this to show you agree with default on)
Ultimately, the merger can also just make it default on if they feel that
would be the best option.

@noahbclarkson
Copy link
Copy Markdown

Because by default every setting should replicate vanilla behavior

No. Default settings in Paper are what people would most likely prefer.

Why isn't async advancements setting turned on by default?

Because I just typed out the setting while not really thinking over defaults.
I'm all for moving it to default on, but I'd like to hear if anyone else agrees
to that first. (Feel free to 👍 this to show you agree with default on)
Ultimately, the merger can also just make it default on if they feel that
would be the best option.

It needs to be default on because its something that not a large amount of server owners will understand. I know a lot of server owners who wouldn't even know what asynchronous means. By making it default it means those server owners get the performance advantage of computing more tasks asynchronously without having to learn the difference between a task being used by the main thread or not. Paper should set its default options to "what people would most likely prefer," and I think that this option being set to default is just that.

@MrIvanPlays
Copy link
Copy Markdown
Contributor

Default settings in Paper are what people would most likely prefer.

Not exactly true but sure

@Proximyst
Copy link
Copy Markdown
Contributor Author

Default settings in Paper are what people would most likely prefer.

Not exactly true but sure

That is literally quoting a project lead.

Copy link
Copy Markdown
Contributor

@krolik-exe krolik-exe left a comment

Choose a reason for hiding this comment

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

default to true

@PaperMC PaperMC deleted a comment from krolik-exe Aug 11, 2020
Copy link
Copy Markdown
Member

@aikar aikar left a comment

Choose a reason for hiding this comment

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

You got it :) this is exactly what I was envisioning. Outside of the few adjustments, I see nothing here that will change game behavior.

So, there's no reason for us to even have a config then, as we only add configs for optimizations if it comes with a con, and i'm not seeing one here.

Comment thread Spigot-Server-Patches/0551-Apply-advancements-async.patch Outdated
Comment thread Spigot-Server-Patches/0551-Apply-advancements-async.patch Outdated
Comment thread Spigot-Server-Patches/0551-Apply-advancements-async.patch Outdated
Comment thread Spigot-Server-Patches/0551-Apply-advancements-async.patch Outdated
@aikar
Copy link
Copy Markdown
Member

aikar commented Aug 11, 2020

Default settings in Paper are what people would most likely prefer.

Not exactly true but sure

@MrIvanPlays What Proxi said is correct. That was a quote from me.

@Proximyst
Copy link
Copy Markdown
Contributor Author

I've amended the PR with the changes requested, and also removed some unnecessary null checks (thanks for the final reminder, IntelliJ!) on the future, as it is set in the constructor.

@krolik-exe
Copy link
Copy Markdown
Contributor

what is the status on this?

@aikar
Copy link
Copy Markdown
Member

aikar commented Aug 17, 2020

Waiting for 1.16.2, we can't merge prs until it's in master

@Proximyst
Copy link
Copy Markdown
Contributor Author

I can rebase it onto 1.16.2 and open a PR if you'd like?

@krolik-exe
Copy link
Copy Markdown
Contributor

krolik-exe commented Aug 19, 2020

You can, if you want to rebase it on 1.16.2, it would be useful for those who merge it, at least so i think. You can correct me if im wrong in the comments

@electronicboy
Copy link
Copy Markdown
Member

rebasing is bad for the git history, and only means that there is double the merging effort

@Proximyst
Copy link
Copy Markdown
Contributor Author

Proximyst commented Aug 19, 2020 via email

@electronicboy
Copy link
Copy Markdown
Member

I misread the last comment, I don't think there'd be an issue rebasing onto .2, too early I thought they meant master

@Proximyst Proximyst changed the title Apply advancements async [1.16.1] Apply advancements async Aug 20, 2020
@Proximyst Proximyst requested a review from a team as a code owner August 25, 2020 02:40
@Proximyst Proximyst closed this Oct 27, 2020
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.

7 participants