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

[WASM] batch attributes updates in Shape::UpdateRender #19048

Open
Xiaoy312 opened this issue Dec 9, 2024 · 0 comments · May be fixed by #19100
Open

[WASM] batch attributes updates in Shape::UpdateRender #19048

Xiaoy312 opened this issue Dec 9, 2024 · 0 comments · May be fixed by #19100
Assignees
Labels
area/performance 📈 Categorizes an issue or PR as relevant to performance kind/enhancement New feature or request platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/shapes-brushes 🔶 Categorizes an issue or PR as relevant to shapes and brushes

Comments

@Xiaoy312
Copy link
Contributor

Xiaoy312 commented Dec 9, 2024

What would you like to be added

		private protected void UpdateRender()
			OnFillBrushChanged(); // fill (int = def-handle, int = colorWithAlpha)
			OnStrokeBrushChanged(); // stroke (^same)
			UpdateStrokeThickness(); // stroke-width (double)
			UpdateStrokeDashArray(); // stroke-dasharray (double[])

can be bundled into a single specialized [JSImport] call

Why is this needed

performance, as we are making multiple js interop calls

For which platform

No response

Anything else we need to know?

avoid reusing SetStyle(string, primitive_type) or SetStyle(string, (string, primitive_type)[])
since passing string across cs-js isn't as performant compared to other primitive type

the some of 4mthods are also called by their respectives OnPropertyChanged
^ consider extra what to set and let the caller to set them // void UpdateXyz() --> (string key, string value) UpdateXyz()
^ or, check if we can omit the OnPropertyChanged update completely?

also replace any TSInteropMarshaller.InvokeJS down the line with [JSImport] call
^ like: OnFillBrushChanged>SetElementFill>InvokeJS

@Xiaoy312 Xiaoy312 added kind/enhancement New feature or request platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/shapes-brushes 🔶 Categorizes an issue or PR as relevant to shapes and brushes area/performance 📈 Categorizes an issue or PR as relevant to performance labels Dec 9, 2024
@Xiaoy312 Xiaoy312 self-assigned this Dec 9, 2024
@Xiaoy312 Xiaoy312 linked a pull request Dec 17, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance 📈 Categorizes an issue or PR as relevant to performance kind/enhancement New feature or request platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/shapes-brushes 🔶 Categorizes an issue or PR as relevant to shapes and brushes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant