Insane perfomrance after tuning the batch and caches.
This commit is contained in:
@ -67,7 +67,7 @@ ui_box_from_key :: #force_inline proc ( cache : ^HMapChained(UI_Box), key : UI_K
|
||||
|
||||
ui_box_make :: proc( flags : UI_BoxFlags, label : string ) -> (^ UI_Box)
|
||||
{
|
||||
profile(#procedure)
|
||||
// profile(#procedure)
|
||||
using ui := get_state().ui_context
|
||||
key := ui_key_from_string( label )
|
||||
|
||||
|
@ -30,7 +30,7 @@ UI_Signal :: struct {
|
||||
|
||||
ui_signal_from_box :: proc ( box : ^ UI_Box, update_style := true, update_deltas := true ) -> UI_Signal
|
||||
{
|
||||
profile(#procedure)
|
||||
// profile(#procedure)
|
||||
ui := get_state().ui_context
|
||||
input := get_state().input
|
||||
|
||||
|
@ -209,10 +209,10 @@ test_whitespace_ast :: proc( default_layout : ^UI_Layout, frame_style_default :
|
||||
|
||||
ui_layout( text_layout )
|
||||
|
||||
profile_begin("label fmt")
|
||||
// profile_begin("label fmt")
|
||||
str.builder_reset( & builder)
|
||||
label := str_fmt_builder( & builder, "line %d", line_id )
|
||||
profile_end()
|
||||
// profile_end()
|
||||
|
||||
line_hbox := ui_widget(label, {.Mouse_Clickable})
|
||||
|
||||
@ -278,7 +278,7 @@ test_whitespace_ast :: proc( default_layout : ^UI_Layout, frame_style_default :
|
||||
}
|
||||
else
|
||||
{
|
||||
profile("line (single-box)")
|
||||
// profile("line (single-box)")
|
||||
|
||||
line_hbox.layout.flags |= { .Size_To_Text }
|
||||
|
||||
@ -286,23 +286,23 @@ test_whitespace_ast :: proc( default_layout : ^UI_Layout, frame_style_default :
|
||||
head := line.first.next
|
||||
for ; head != nil;
|
||||
{
|
||||
profile("write ast node")
|
||||
// profile("write ast node")
|
||||
str.write_string( & builder, head.content )
|
||||
head = head.next
|
||||
}
|
||||
|
||||
profile("intern")
|
||||
// profile("intern")
|
||||
line_hbox.text = str_intern( to_string( builder ) )
|
||||
}
|
||||
|
||||
if len(line_hbox.text) > 0 {
|
||||
profile("append actual")
|
||||
// profile("append actual")
|
||||
array_append( widgets_ptr, line_hbox )
|
||||
text_layout.pos.x = text_layout.pos.x
|
||||
text_layout.pos.y -= size_range2(line_hbox.computed.bounds).y
|
||||
}
|
||||
else {
|
||||
profile("end")
|
||||
// profile("end")
|
||||
widget := & widgets.data[ widgets.num - 1 ]
|
||||
if widget.box != nil {
|
||||
text_layout.pos.y -= size_range2( widget.computed.bounds ).y
|
||||
|
Reference in New Issue
Block a user