-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
[Bug] Large amount of lag with 10+ nodes. #60
Comments
Hi, 10+ nodes is definitely not a large amount of nodes for Nodify. I would suggest to upgrade to the latest version or at least the next version if that's possible, and see if the issue persists. You can also try setting the Connector.EnableOptimizations static field to false before rendering the editor. |
Hi. Thanks for the reply! I updated to the latest version and tried messing with the Connector.EnableOptimizations field with no luck. For reference, this is what our MainWindow.xaml looks like
|
This seems to be a hardware issue. (and WPF struggling to render lots of controls at once)
The camera panning is nothing more than updating a RenderTransform. You can validate this by moving the nodes offscreen and checking if the panning is working as expected. If you want to check what's causing the rendering issue you could try eliminating potential issues one by one. (e.g. the icons, the port inputs, the DropsShadowEffect's you have some). I also recommend trying rendering a few hundred nodes in the playground application and comparing the offscreen and onscreen performance. There's one rendering optimization that is applied when zooming out to 70% (see I have around 800 nodes in this video and it's still working smoothly. As you can see, the lag increases with the number of nodes present on the screen (by zooming out) until it reaches the rendering optimization threshold and it converts everything to a bitmap. nodes.mp4A possible solutionIf rendering a node is expensive, try caching the result to a bitmap. Make sure you render the bitmap at the editor's maximum scale (2.0 by default) to avoid blurry results.
<nodify:NodifyEditor.ItemContainerStyle>
<Style TargetType="{x:Type nodify:ItemContainer}"
BasedOn="{StaticResource {x:Type nodify:ItemContainer}}">
<Setter Property="CacheMode">
<Setter.Value>
<BitmapCache RenderAtScale="2" />
</Setter.Value>
</Setter>
</Style>
</nodify:NodifyEditor.ItemContainerStyle> There are 1000 nodes in this video and the performance improved a lot by caching the cached.mp4I hope this helps! |
This ended up being a performance issue with a theme package we were using. Specifically the styling it was using for the textbox. Thanks for all your help! |
Hi,
Having some issues with lag when adding a large amount of nodes (10+)
2023-04-18.14-34-11.mp4
Only present with nodes that have UI elements in the port (textbox, combobox, etc.). With or without bindings. It appears to only effect the camera panning which you can see in the attached video. The rest of the UI is lag free.
Version 1.7
The text was updated successfully, but these errors were encountered: