Subj : Filtering a list of messages
To   : Digital Man
From : Nightfox
Date : Thu Nov 09 2023 03:40 pm

 Re: Filtering a list of messages
 By: Digital Man to Nightfox on Thu Nov 09 2023 03:15 pm

>> MsgBase.get_all_msg_headers() and then filtering it, removing vote headers

DM> You shouldn't have to remove vote messages manually if you pass the
DM> includes_votes argument as false.

DM> MsgBase.get_all_msg_headers() was written (added to the MsgBase class)
DM> specifically for performance - it's the fastest way to read *all* the
DM> message header's in a message base in one operation. Subsequent filtering
DM> (e.g. of deleted messages), should be very fast, unless you're doing
DM> something unexpect (re-reading the message header or index of messages
DM> again?). I'd have to examine your code to for sure, but one thing this
DM> other sysop could do is compare the performance of msglist.js against your
DM> own message lister and see if the performanced is different or the same.

DM> One optimization possible for loading *all* messages would be to load the
DM> message base *index* only (which is smaller/faster) and then only load
DM> message headers when needed (possibly doing this asynchronously, in the
DM> background, while displaying the first loaded message headers to the
DM> user). This does mean that searching/sorting might be limited until all
DM> the headers are loaded.

DM> Another big optimization would be for *new* message scans or *your*
DM> message scans - in those scenarios, you wouldn't need or want to load all
DM> the messages headers of the msgbase since most of the time you'll only be
DM> displaying a small fraction of them (if any). There's plenty of room for
DM> optimization of large message bases during *scans*.

Thanks - I think those are some good tips.

Nightfox

---
� Synchronet � Digital Distortion: digitaldistortionbbs.com