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: | Lmorchard |
---|---|
Location: | Portland, OR |
Users: | 62 |
Nodes: | 16 (0 / 16) |
Uptime: | 25:09:20 |
Calls: | 372 |
Files: | 1 |
Messages: | 22,704 |