Open dhardy opened 3 years ago
This is done
The Manager::set_hover
method (src/event/manager.rs:238
) requests a redraw whenever the mouse moves over a different widget, since the "hover status" of a widget may affect how it is drawn (e.g. to highlight a button). Many widgets, however, are not affected by this, thus many of these redraws are unnecessary; unfortunately the Manager doesn't know which widgets have hover highlighting and currently there is no way to communicate this.
Possible ideas:
WidgetConfig
Reduce size of data types
PressSource
is surprisingly large: the value of Touch
is 64-bits since on OSX it is a pointer (on all other platforms it is a 32-bit integer); adding the tag makes this a 16-byte type. If the tag could be moved elsewhere (into Event
or within the value of Touch
) then this and Event
would be smaller. Hint: pointers are aligned, thus the smallest 2-3 bits must be zero; unfortunately this requires unsafe
platform-specific code.stack_dst
crate which was used to avoid some heap allocations. No performance issues were noted as a result and this removed an unsafe
and unstable dependency. Eventually Rust may directly support returning unsized trait-impl objects on the stack, but until then it doesn't appear to be a real issue.
A tracker for notable optimisations (generally low priority so long as the UI appears sufficiently fast).
ListData
(thousands of items): see #164ListView::update_widgets
until event queue is empty: see #164