Skip to content

Conversation

@Zoriot
Copy link
Member

@Zoriot Zoriot commented Jan 26, 2026

Replace Clipboard with CPUOptimizedClipboard for peformance improvements

This also fixes that the clipboard is never deleated and grows infinite. There is also MemoryOptimizedClipboard but that has most likely worse performance.

…formance improvements

This also fixes that the clipboard is never deleated and grows infinite.
There is also MemoryOptimizedClipboard but that has most likely worse performance.
@Zoriot Zoriot self-assigned this Jan 26, 2026
@Zoriot Zoriot added bug Something isn't working high priority labels Jan 26, 2026
Copy link
Contributor

@tintinkung tintinkung left a comment

Choose a reason for hiding this comment

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

Should we optimize the uses of these clipboards instead?

Our schematic file #getInitialSchematicBytes is compressed but reading it to a clipboard can be pretty large:

  • 3+ million blocks by default 50 blocks environment radius
  • On disk, FAWE read ALL blocks data and optimize it per 2 byte character
    • It kinda does the same in memory as a byte array (correct me if not)
    • Even in CPU optimized, that block data need to be allocated somewhere right?
  • thats 6+ million bytes ~6MB each clipboard
  • It make sense for pasting the plot world initially, but for getting metadata like its region? meh

Also hardcoding it in memory kinda defeat the purpose of FAWE clipboard config?

@Zoriot
Copy link
Member Author

Zoriot commented Feb 2, 2026

Should we optimize the uses of these clipboards instead?

Our schematic file #getInitialSchematicBytes is compressed but reading it to a clipboard can be pretty large:

* 3+ million blocks by default 50 blocks environment radius

* On disk, FAWE read ALL blocks data and optimize it per 2 byte character
  
  * It kinda does the same in memory as a byte array (correct me if not)
  * Even in CPU optimized, that block data need to be allocated somewhere right?

* thats 6+ million bytes ~6MB each clipboard

* It make sense for pasting the plot world initially, but for getting metadata like its region? meh

Yea that's the case afaik. What's your suggestion for that? I agree, especially because it seems like we are not caching the plot. So that's just unnecessary calls. I think it would be fine when pasting also extract all the metadata we need for various things and cache that. Would need some big works trough.
I think it should also be possible to save a lot less data because we basically only need the first layer.
I think that's far out of the PR's window/use. Can you create a issue for that?

Also hardcoding it in memory kinda defeat the purpose of FAWE clipboard config?

At least in my testing the fawe config have not an effect at all (at least the delete-after-days). Generally it's not fine graded and doesn't do that what the users expect imo. I also don't see any use of saving the Clipboard to the disc itself, at least in the ps current implementation.
We could add options in Plot-System, but i don't think that's really necessary.

Copy link
Contributor

@tintinkung tintinkung left a comment

Choose a reason for hiding this comment

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

I cant replicate delete-after-days not working, but i guess it works if disk clipboard and others is consider useless

@Zoriot Zoriot merged commit 65b8e25 into main Feb 3, 2026
2 checks passed
@Zoriot Zoriot deleted the bug/fawe branch February 3, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working high priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants