Skip to content

Refactor feed insertion to use original feed directly#4546

Open
erikologic wants to merge 1 commit intobluesky-social:mainfrom
erikologic:patch-1
Open

Refactor feed insertion to use original feed directly#4546
erikologic wants to merge 1 commit intobluesky-social:mainfrom
erikologic:patch-1

Conversation

@erikologic
Copy link

Should provide a minimal performance gain

Should provide a minimal performance gain
@ThisIsMissEm
Copy link
Contributor

Sounds like formatAndInsertPosts may be mutative, so maybe that's why the copy was happening?

@erikologic
Copy link
Author

@ThisIsMissEm

Sounds like formatAndInsertPosts may be mutative, so maybe that's why the copy was happening?

Yeah I wondered, but the copy is A) shallow B) for an object that AFAIU is the AppView server response so its life should be bound to this XRPC execution and after that we should only care about the resulting feed.

BTW if you want to protect against mutations you should do so in the writer and not the coordinator, or use languages/data structures that enforce immutability IMO.
Is hard to code when you have to worry of what could happen in nested code paths.

NABD anyway

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.

2 participants