Bug 61405

Summary: A faster ffs(3)
Product: Base System Reporter: Colin Percival <cperciva>
Component: binAssignee: Colin Percival <cperciva>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
ffs.c none

Description Colin Percival 2004-01-16 04:00:34 UTC
ffs(3) currently loops, testing one bit per iteration until the
least set bit is found.  This can be significantly improved.

Fix: I'm not sure how important this is, since ffs is a single instruction on 
many processors, but the following magic is very fast:
Comment 1 Kris Kennaway freebsd_committer freebsd_triage 2005-04-09 01:49:06 UTC
Responsible Changed
From-To: freebsd-bugs->cperciva

Submitter is now a committer
Comment 2 Colin Percival freebsd_committer freebsd_triage 2008-02-24 00:11:34 UTC
State Changed
From-To: open->closed

I don't plan on doing anything with this, and the speed-up, if any, is 
minimal on modern CPUs.