Project

General

Profile

Actions

Bug #3937

open

AdiIRC slowing down on dialogs when user list is too heavy

Added by westor (GR) almost 6 years ago. Updated almost 6 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Scripting
Target version:
Start date:
06/07/2018
Due date:
% Done:

0%

Estimated time:
Operative System:
All
Regression:
No

Description

Hello,

There is something strange that i saw, when having a huge userlist database and trying to open a dialog it slowing down the dialog actions (e.g: changing tabs or during the init progress) i cannot imagine how does userlist effecting that part, i tested and in other parts and it seems only in dialogs having that huge slow, i will provide some test codes to test it and see how it is acting thought.

Testing Dialog Code:

dialog test_table {
  title "Testing" 
  size -1 -1 259 113
  option dbu
  tab "Tab 1", 5, 5 3 252 105
  list 1, 12 21 239 85, tab 5 size
  tab "Tab 2", 6
  list 2, 11 21 240 85, tab 6 size
}

ON *:DIALOG:test_table:init: {
  var %i = 1
  while (%i <= 100) { did -a $dname 1,2 test %i | inc %i }
}

Adding items to userlist:

//var %t = 10000 | var %i = 1 | while (%i <= %t) { .auser testing %i | inc %i } | echo -a IS: Finished!

Try adding a huge database (about 5000-10.000) and run the dialog (/dialog -m test_table test_table) and try changing tabs or see the init progress, then remove the hole userlist database and try again to see how fast it will be.


Files

2018-06-08_14-07-15.mp4 (1.3 MB) 2018-06-08_14-07-15.mp4 Testing dialog with just only 2 lists westor (GR), 06/08/2018 01:10 PM
2018-06-08_14-11-05.mp4 (1.49 MB) 2018-06-08_14-11-05.mp4 Testing my project with a list and more items westor (GR), 06/08/2018 01:13 PM
2018-06-08_15-28-08.mp4 (4.33 MB) 2018-06-08_15-28-08.mp4 westor (GR), 06/08/2018 02:33 PM
Actions #1

Updated by westor (GR) almost 6 years ago

Typo error on testing example code, sorry, use that new for testing out:

dialog test_table {
  title "Testing" 
  size -1 -1 259 113
  option dbu
  tab "Tab 1", 5, 5 3 252 105
  list 1, 12 21 239 85, tab 5 size
  tab "Tab 2", 6
  list 2, 11 21 240 85, tab 6 size
}

ON *:DIALOG:test_table:*:init: {
  var %i = 1
  while (%i <= 100) { did -a $dname 1,2 test %i | inc %i }
}
Actions #2

Updated by Per Amundsen almost 6 years ago

I don't see any link between the size of the user access list and changing tabs in the dialog, why would there be?

For the listbox itself, even with 10000 items, it's swaps instantly.

However doing /auser in a loop like that is very slow since it writes the full file and reads it back on every iteration, it wasn't designed with loops in mind.

Updated by westor (GR) almost 6 years ago

The /auser was just an example to add items to test it nothing more, the huge problem is that if there are a lot of items in the userlist (between 5000-10000) then the adiirc slowing down the dialog progresses (e.g: changing tabs, initalization,etc), i will provide you some test videos to see what exactly i mean.

Actions #4

Updated by Per Amundsen almost 6 years ago

I think you are leaving out some details here.

Are you or are you not accessing auser data in your dialog?

dialog test_table {
  title "Testing" 
  size -1 -1 259 113
  option dbu
  tab "Tab 1", 5, 5 3 252 105
  list 1, 12 21 239 85, tab 5 size
  tab "Tab 2", 6
  list 2, 11 21 240 85, tab 6 size
}

ON *:DIALOG:test_table:*:init: {
  var %i = 1
  while (%i <= 100) { did -a $dname 1,2 test %i | inc %i }
}

Have you tried running this script on a stock AdiIRC with no other scripts?

Actions #5

Updated by westor (GR) almost 6 years ago

I am not using userlist into both videos but it is effecting that situation, i was suprised too because i cannot imagine why userlist items slowing down the dialogs.

I've also try it into a clean adiirc (portable) with no other scripts running and it does NOT effecting that, but while i was testing out the codes one by one to reproduced it i saw that if i have a lot of codes lines loaded (about 20000 lines) in the total loaded scripts number with 10000 userlist items loaded in Users then the adiirc slowing down on dialogs.

Total Loaded Scripts Lines Code:

//var %t = $script(0) | var %i = 1 | while (%i <= %t) { var %lines = $lines($script(%i)) | var %total = $calc(%total + %lines) | inc %i } | echo -a IS: %total

Also i try to use Ignore feature from the Scripts Editor to see how it is going on, then when i ignored all the other loaded scripts then it speeds up, if i unignore them then it is slowing down, this is only effecting if you have a heavy userlist, i will provide you an video about it.

Actions #6

Updated by Per Amundsen almost 6 years ago

Total amoubt of lines of scripts doesn't matter, internally everything is broken down into sections, tokens etc.

Since switching tabs triggers on DIALOG, maybe one or more on DIALOG event is triggered from another script and doing something heavy, I suggest disabling one script at the time until you find it.

Actions #7

Updated by westor (GR) almost 6 years ago

I test this to see if an other ON DIALOG event is triggering from an other script file but it doesn't, on other script files the ON DIALOG event has different name of dialog name to trigger thought.

I don't have something like:

ON *:DIALOG:*:*:*: { }
into noone of my loaded scripts.

Actions #8

Updated by Per Amundsen almost 6 years ago

Okay, but I would still try "Ignore" one script at the time and see if you discover something.

Actions #9

Updated by Per Amundsen almost 6 years ago

I did some digging, looking up a user access level is pretty slow, the more levels, the slower it gets and each on DIALOG event does a lookup, however I found that the user access level lookup is done before checking the :*: parameters, that would explain why disabling other on DIALOG scripts is faster, since it has to do less user access level lookups.

I moved the check after the other checks in on DIALOG in this build https://adiirc.com/build/AdiIRC64.exe.

Actions #10

Updated by westor (GR) almost 6 years ago

Yes, the problem solved, i try your build and now the speed is as it should be.

- Thanks!

Actions #11

Updated by Per Amundsen almost 6 years ago

Okay that's good to know, the problem is, this is not the correct behavior, user level access should be checked first, not sure what to do about that.

mIRC will have the same problem.

Actions #12

Updated by westor (GR) almost 6 years ago

I've also test that in mIRC and it's delay is 200ms to 500ms on 10.000 items in user list :P , but now the AdiIRC is faster than mIRC AND in that part! 0-50ms delay on AdiIRC is perfect.

Actions #13

Updated by Per Amundsen almost 6 years ago

Sure, because it's not doing the check properly, but I have to put it back so everything works correctly again, which means it will be slow again, at least until I find some kind of work around.

Actions #14

Updated by Per Amundsen almost 6 years ago

Just to be clear, the next AdiIRC beta is gonna be slow again, the build I made was just to test what the cause might be.

Actions #15

Updated by westor (GR) almost 6 years ago

Ok, i hope for a fix in the future :)

Actions

Also available in: Atom PDF