Image: Reduce 'block-editor' store subscriptions#57358
Conversation
|
Size Change: +6 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
t-hamano
left a comment
There was a problem hiding this comment.
This change looks fine, but is there a way to see how much performance has improved?
I checked the logs using this debug code(c029303), but I don't know what number to use to compare it to trunk...
For example, below is the log output immediately after reloading the browser for a post with 256 image blocks.
sub block-editor 1000
index.js:107 sub block-editor 2000
index.js:114 ran waiting list: speed 58344 i/s avg 58344 i/s its 846 srem 14.5 frem 0 queued 1714
index.js:114 ran waiting list: speed 66296 i/s avg 62320 i/s its 537 srem 8.1 frem 0 queued 1177
index.js:114 ran waiting list: speed 70869 i/s avg 65170 i/s its 1141 srem 16.1 frem 0 queued 36
index.js:114 ran waiting list: speed 21176 i/s avg 54171 i/s its 36 srem 16 frem 14.3 queued 0
|
@t-hamano, this is a micro-optimization; I don't expect it to have a big impact on its own. But similar optimizations add up in the end. Here's a similar PR for Gallery block #57240. P.S. Code from c029303 only logs after 1000 subscriptions. You won't see a difference for small improvements like this. |
t-hamano
left a comment
There was a problem hiding this comment.
@t-hamano, this is a micro-optimization; I don't expect it to have a big impact on its own. But similar optimizations add up in the end. Here's a similar PR for Gallery block #57240.
P.S. Code from c029303 only logs after 1000 subscriptions. You won't see a difference for small improvements like this.
I see, thank you for teaching me 👍
What?
PR combines two
block-editorstore subscriptions into one.Why?
Reduces the number of store subscriptions each time the Image block is rendered. See #54819 (comment).
How?
I just moved
multiImageSelectioninto the existinguseSelectfor the block editor store. It doesn't depend on theimagevalue, so there is no need to group them together.Testing Instructions
Testing Instructions for Keyboard
Same