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

Potential performance improvement: Turn partial publish into full publish if outcome is the same #5303

Closed
Tracked by #4388
bwaidelich opened this issue Oct 20, 2024 · 3 comments · Fixed by #5301
Closed
Tracked by #4388

Comments

@bwaidelich
Copy link
Member

TL;DR: A partial publish is much slower and more complex than a full publish of a workspace – we can detect if a partial publish already contains all pending events and turn it into a full publish in this case.

For Neos the default publishing mode is to only publish events of the currently selected document (IMHO a full publish should be the default but that discussion is out of scope!).
A partial publish is much more complex than a full publish because we first have to split affected and remaining events and publish those to different newly forked streams...

During the splitting of those events we could handle the PublishIndividualNodesFromWorkspace like the corresponding PublishWorkspace command if $remainingCommands is empty.

The same should be true for DiscardIndividualNodesFromWorkspace vs DiscardWorkspace

Related: #4388

@mhsdesign
Copy link
Member

jup @kitsunet and me had the same thoughts :) it will be implemented via #5301

@github-project-automation github-project-automation bot moved this from Prioritized 🔥 to Done ✅ in Neos 9.0 Release Board Oct 28, 2024
@mhsdesign
Copy link
Member

Funnily after thinking about this #5301 doesnt really solve this case really. As a full publish will with that pr also do the simulation and apply the commands. We only said "do a full publish by emitting WorkspaceWasPublished this is simpler for the projections to handle" which is not true either. The projections handle the events the same. So just for completion: We always have deserialise all the commands that need to be reapplied and splitting them by ids doesnt cost anything. The costly simulation will be carried out for both partial and full publish.

And just for completeness with #5385 will the WorkspaceWasPartially published event actually removed as we only need a WorkspaceWasPublished event at all.

@mhsdesign mhsdesign closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2024
mhsdesign added a commit to mhsdesign/neos-development-collection that referenced this issue Dec 9, 2024
Reverts d2d9faa partially

Initially this change was done to fix neos#5303
But that was a hoax see neos#5303 (comment)

we always emit the `WorkspaceWasPublished` event and this just simplifies the code-path again.

For the discard all case, the code is stil a little easier to read _with_ the condition.
@bwaidelich
Copy link
Member Author

We only said "do a full publish by emitting WorkspaceWasPublished this is simpler for the projections to handle"

I don't know who said that, but it wasn't me. My point was: If is much easier to reason about the events if we can eliminate the last case of:

  • all changes were published
  • some changes were published
  • all changes were published but through a different button

with #5385 will the WorkspaceWasPartially published event actually removed

That would be the great ofc, but I really don't understand how #5385 is supposed to work. And IMO the difference between a partial and a full publish has a different meaning and should not be distinguished just by some metadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants