I would be surprised if this patch has much effect, isn't the main change that one DCClient will hog the main application thread while it processes all it's messages from dclib?
I think there is a memory leak since you return early on the NickList message, then DCMsg is not deleted. I was assuming modern hubs do not send any NickList messages anyway,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
On my system with this patch adding of nick-list with more than 3000 elements takes ~2sec, with old version - 6-8sec.
>that one DCClient will hog the main application thread while it processes
all it's messages from dclib?
Yes, but really we have this situation only when DCClient "starts" because hub send to us a lot of messages (ex, long nick-list), processing of nick-list is potentially long operation and i set timer interval to 150msec for fast getting of all portions of nick-list. In other sistuations DCClient will not hog the main application thread.
> I think there is a memory...
Fixed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What about using QThread instead of QTimer? something like(in QThread ckass):
while (true){
DCClient_getMessages();
usleep(300);
}
And DCClient will not hog the main application thread.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
dcclient patch
I would be surprised if this patch has much effect, isn't the main change that one DCClient will hog the main application thread while it processes all it's messages from dclib?
I think there is a memory leak since you return early on the NickList message, then DCMsg is not deleted. I was assuming modern hubs do not send any NickList messages anyway,
second dcclient patch
On my system with this patch adding of nick-list with more than 3000 elements takes ~2sec, with old version - 6-8sec.
>that one DCClient will hog the main application thread while it processes
all it's messages from dclib?
Yes, but really we have this situation only when DCClient "starts" because hub send to us a lot of messages (ex, long nick-list), processing of nick-list is potentially long operation and i set timer interval to 150msec for fast getting of all portions of nick-list. In other sistuations DCClient will not hog the main application thread.
> I think there is a memory...
Fixed.
What about using QThread instead of QTimer? something like(in QThread ckass):
while (true){
DCClient_getMessages();
usleep(300);
}
And DCClient will not hog the main application thread.