Skip to content

Apply advancements async#3932

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

Apply advancements async#3932
Proximyst wants to merge 1 commit into
PaperMC:masterfrom
Proximyst:async-advancements-2

Conversation

@Proximyst
Copy link
Copy Markdown
Contributor

Asynchronous advancements, take 2.

Advancements are loaded in the same way as before, except asynchronously.
Unlike #3454, this uses a delegate class to make plugins like Citizens not spew
errors as if it's their fulltime job.

Copy link
Copy Markdown
Contributor

@tofipix tofipix left a comment

Choose a reason for hiding this comment

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

Thanks!, I can confirm that it works , and it helped my server with login performance!

@Toffikk
Copy link
Copy Markdown
Contributor

Toffikk commented Jul 23, 2020

I hope that it will be merged soon

@Toffikk
Copy link
Copy Markdown
Contributor

Toffikk commented Jul 29, 2020

@Proximyst What do You think about licensing Your work/patches under MIT?

@Proximyst
Copy link
Copy Markdown
Contributor Author

I am contributing these to an MIT licensed project; they are therefore also licensed under the same licence.

@Toffikk
Copy link
Copy Markdown
Contributor

Toffikk commented Jul 29, 2020

Isn’t Paper licensed under GNU 3 , because the last time i checked , Every author who want their patches be licensed under MIT , then they must write theirselves down in „license.md” file

@Proximyst
Copy link
Copy Markdown
Contributor Author

Aikar just corrected me on that on Discord, yeah. It's still free software, so I don't particularly care.

@Toffikk
Copy link
Copy Markdown
Contributor

Toffikk commented Jul 30, 2020

It still would be nice if You license Your patches under MIT so anyone can use them

@Proximyst
Copy link
Copy Markdown
Contributor Author

My contributions are GPLv3. This means anyone can use them, granted they give me the credit for my code. If you'd like to discuss my choice in what licence to keep it under, GitHub comment section is not the place.

@CDFN
Copy link
Copy Markdown

CDFN commented Jul 30, 2020

IMG_20200730_145744.jpg
No need to ping & ask for review. ASAP Aikar will review it so no worries. @tofikarz

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.

Sorry been busy but been meaning to come give feedback.

Overall, absolutely not ok with this implementation. This is a maintenance nightmare that puts it into category of "Drop this every update until proxi resubmits it" which I don't like.

Really needs to be back closer to original impl of start loading the data early, but if issues were found with version 1 then I have a new implementation proposal

On creating the EntityPlayer in PlayerList#attemptLogin, we can break the PlayerLoginEvent right below it into a split method, and have a marker for "advancementDataReady = true" when its done.

Then the network manager is ticking thats calling this, we can delay progressing to the next stages of the login operation until the data is ready.

But I have to ask, is this change even still needed?

We merged a major performance optimization to advancements. Is there NEW benchmarks showing a heavy hit? how much time are we talking about trying to save here.

If the cost of this work results in it being slower for majority of players, it's not worth doing.

We'd need to see what a "has been playing for a dew days" player might look like for performance for baseline, and "a veteran with most advancements completed" for the worst case scenario.

if a veteran was 1ms and moderate players is like 0.1ms, i'm not sure its worth the cost to do this.

Also what was the issues with previous attempt? It was closer to what id expect, just did more than I expected. I would of left the field in place, made it non final, and then anytime .getAdvancementData() is called and the field ISNT set yet, to join the future to block until it is finished, so its async long as it finishes before something accesses it.

there was more changes in that first PR than I expected, returning null instead of data in scenarios that were previously not possible, so thats why I expect bugs were introduced.

Id love to see attempt 1 cleaned up instead to touch less, but worse case, delay PlayerLoginEvent until its ready - though we may be able to say that advancement data is ok to not be used in PlayerLoginEvent ,and delay PlayerJoinEvent until both chunk AND advancement is ready.

But either way, I'm not ok with this current PR.

@Proximyst
Copy link
Copy Markdown
Contributor Author

TL;DR: This PR will be closed and reopened in a new PR in the future if(/when?) I retry the original approach with Aikar's feedback taken into account.


This is a maintenance nightmare that puts it into category of "Drop this every update until proxi resubmits it" which I don't like.

I disagree. All methods but two are just generated by IntelliJ to delegate. If Mojang changes advancement loading, we're fucked with a patch to async load them anyways.

But I have to ask, is this change even still needed?

Honestly, probably not. My only real feedback on this is others reporting (on this PR, and from talking with @Puremin0rez who pulled this in their fork) it be beneficial.

Also what was the issues with previous attempt?

Mostly just the god damn plugins we sadly have to give a shit about. Citizens was the main one complaining every so often with its player NPCs, and I personally don't like console spam, so I decided to just redo it in a way that works and avoids Citizens spam.

Id love to see attempt 1 cleaned up instead to touch less, but worse case, delay PlayerLoginEvent until its ready - though we may be able to say that advancement data is ok to not be used in PlayerLoginEvent ,and delay PlayerJoinEvent until both chunk AND advancement is ready.

I'll take a stab at that in the future in a new PR. At the moment, I don't have a need to recreate it, and have others projects I have to focus on.

@Proximyst Proximyst closed this Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants