twig / dcxdll

Dialog Control eXtensions for mIRC
BSD 3-Clause "New" or "Revised" License
23 stars 2 forks source link

Performance Bottleneck with complex CLA/DCXML #78

Open Daedalus11069 opened 8 months ago

Daedalus11069 commented 8 months ago

I'm using mIRC 7.75 and dcxdll-3.1-git978 on Windows 11 Pro (22H2, OS Build 22621.2861 with Experience Pack 1000.22681.1000.0)

As I alluded to at the end of #77, following the update from 469 to 952/978(both were affected), I encountered a performance issue with larger CLA/DCXML structures.

Whenever I open up the interface I made, there's a long period of what appears to be sizing/margin/padding adjustments visually taking place before the interface eventually settles and can be interacted with. Below is a gif example:

performance issues1

Below is the test case I used to create the interface:

DCXML ```xml ```
mSL test case ```mirc dialog MainInterface { title "Interface" size 213 710 510 110 option dbu } alias interfaceopen { clear if ($dialog(intf1) == $null) { dialog -m intf1 MainInterface } else { dialog -x intf1 dialog -m intf1 MainInterface } } on *:DIALOG:intf1:init:0:{ var %verbose = v dcx Mark $dname interface.events xdialog -b $dname +tz xdialog -T $dname +sp ;dcxml -d [DNAME] [Name of dialog element you wish to load] [path to dcxml file] dcxml -d $+ %verbose $dname interface $qt($mircdirscripts\interface.xml) .timer -d 1 0 xdialog -l $dname update .timer -d 1 0 xdialog -j $dname .timer -dm 1 500 xdock -m $dialog($dname).hwnd +b .timer -dm 1 500 xdock -r $dialog($dname).hwnd + 0 %h } alias interface.events { ; Nothing to do here } ```
OokEek commented 8 months ago

The dcxml/cla part runs fine when not docked. As a side note when using dcxml you must wait for the dcxml ready event before doing anything further to the dialog. I'll look into why xdock is messing up cla.

Here is a version that loads nice & fast.

dialog MainInterface {
  title "Interface"
  size 213 710 510 110
  option pixels
}

alias interfaceopen {
  clear
  if ($dialog(intf1) == $null) {
    dialog -m intf1 MainInterface
  }
  else {
    dialog -x intf1
    dialog -m intf1 MainInterface
  }
}
alias -l _after_init {
  xdock -p
}
on *:DIALOG:intf1:init:0:{
  var %verbose = v
  dcx Mark $dname interface.events

  xdialog -b $dname +tz
  xdialog -T $dname +sp

  xdock -m $dialog($dname).hwnd +b
  .timer 1 0 dcxml -d $dname interface $qt($mircdirscripts\interface.xml)
}

alias interface.events {
  if ($2 == ready) {
    .timer 1 0 _after_init $1
  }
  elseif ($2 == isverbose) {
    echo -s ask verbose (false)
    return $false
  }
  elseif ($2 == error) echo -s DCXError: $1 ID: $3 Type: $4 Prop: $5 Cmd: $6 Error: $7-
  ;else echo -s cc: $1-
}