[Mono-bugs] [Bug 418272] New: Scheduling time complexity of Sys.Threading.Timer is O(n)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Aug 19 07:43:16 EDT 2008


           Summary: Scheduling time complexity of Sys.Threading.Timer is
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: juraj at hotfeet.ch
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

The Timer class uses a hashtable (with both key and value pointing to the Timer
object) for keeping track of active timers. While the starting, changing and
disposing of timers are all O(1) operations, the scheduling method
SchedulerThread is of time complexity O(n) (n being the number of active

With System.Web using Sys.Threading.Timer for both session/cache expiration and
script timeouts, SchedulerThread might be responsible for a few occasional CPU
spikes on websites with lots of visitors.

Replacing the hashtable with a red-black tree could flatten those spikes. It
might make sense to adapt class/System/System.Collections.Generic/RBTree.cs.


Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list