I'll play with tuning that in a couple of days. The first thing I notice is the reference to msgbase.total_msgs in your loop. It would be an improvement in speed to cache this property in a local variable as every time you read that property, the underlying code in the MsgBase class goes and reads the status of the message base:
var total_msgs = msgbase.total_msgs;
for (var i = 0; !subBoardHasPolls && (i < total_msgs); ++i)
I tried this enhancement on Vert and it made only a slight improvement in performance, so that's not the main issue. It could be a problem in the get_msg_index method. I'll look into it.
Re: SlyVote
By: Digital Man to Nightfox on Tue Aug 08 2017 11:56 am
I'll play with tuning that in a couple of days. The first thing I notice is the reference to msgbase.total_msgs in your loop. It would be an improvement in speed to cache this property in a local variable as every time you read that property, the underlying code in the MsgBase class goes and reads the status of the message base:
var total_msgs = msgbase.total_msgs;
for (var i = 0; !subBoardHasPolls && (i < total_msgs); ++i)
I tried this enhancement on Vert and it made only a slight improvement in performance, so that's not the main issue. It could be a problem in the get_msg_index method. I'll look into it.
Hi DM - I know this is an old message I'm replying to - we were discussing speed-related issues when I was initially working on SlyVote. I was curious if you had ever found anything that might help the speed issues we had noticed?
I added the MsgBase.get_index() method about a year ago for use in msglist.js which enhanced the performance considerable. Have you tried using that?
Re: SlyVote
By: Digital Man to Nightfox on Tue May 19 2020 03:00 pm
I added the MsgBase.get_index() method about a year ago for use in msglist.js which enhanced the performance considerable. Have you tried using that?
Yes, SlyVote uses get_index if it's available.
Sysop: | Kurt Hamm |
---|---|
Location: | Columbia, SC |
Users: | 8 |
Nodes: | 20 (0 / 20) |
Uptime: | 177:51:14 |
Calls: | 2,733 |
Files: | 64 |
Messages: | 842,265 |