https://gitlab.synchro.net/main/sbbs/-/commit/08d1393ef735398e9b51098e
Modified Files:
src/sbbs3/data_ovl.cpp sbbs.h userdat.c
Log Message:
Bulk-read the user base when searching it for a duplicate field
finduserstr() walked user.tab through readuserdat(), which per record
does a seek, a shared byte-range lock, a read, and an unlock. With the
data directory on an SMB share each lock is a synchronous round trip,
and a new-user sign-up runs this scan five times (IP address, alias
against real names, handle, then real name and handle again from
newuser.cpp as the safety net 4182066dd5 (2025-12-30) added). On vert
that was about 8 seconds of "Searching for duplicates" meters.
Read the file 64 records at a time without the per-record lock and
split the records in memory, as 247ed952d2 (2026-08-17) did for
total_users(). Windows byte-range locks are mandatory, so a bulk read overlapping a record another process is rewriting fails; any record
the bulk read didn't deliver is re-read singly with the lock, since a
false "not found" here would admit a duplicate. The final progress
callback reports the scan complete rather than the record it stopped
on.
Draw the meter only once a scan has outlasted the progress interval,
and emit the trailing erase only if it was drawn, so a fast scan
leaves nothing on screen. The 500 ms interval is now PROGRESS_INTERVAL
so both sites share it.
Measured on a 1,457-record user base over SMB: one scan drops from
1,639 ms to 12 ms.
The per-record scan dates from 8a22b2466a (2022-10-17).
Co-Authored-By: Claude Fable 5.1 <
noreply@anthropic.com>
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)