Browse Prior Art Database

Bit Vector for Optimal Performance of Calendar Busy Bar Control

IP.com Disclosure Number: IPCOM000106370D
Original Publication Date: 1993-Oct-01
Included in the Prior Art Database: 2005-Mar-21
Document File: 4 page(s) / 82K

Publishing Venue

IBM

Related People

Estes, MW: AUTHOR [+2]

Abstract

This article describes a performance optimization technique for use in the implementation of a Calendar Busy Bar Control/Widget.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Bit Vector for Optimal Performance of Calendar Busy Bar Control

      This article describes a performance optimization technique for
use in the implementation of a Calendar Busy Bar Control/Widget.

      A Busy Bar Control is a histogram-like bar graph plotting a
calendar application users free time and scheduled time for a week.
A portion of it might look like:

     -----------------------
     |
     |       Mon  Tue  Wed  ....
     |----------------------
     |
     | 8:00   X
     |        X
     | 9:00        X
     |             X    X
     |10:00   X    X    X
     |        X    X
     |11:00   X
     |        X         X
     |  .
        .
        .
where each 'X' represents a block of time which has been scheduled.
The DATA used for generating the blocks of time for the Busy Bar is
extracted from a list of EVENTS.  Each EVENT has (among many other
fields) a start time, an end time, and a date.  These three pieces of
information yield the data from which the points of the Busy Bar can
be constructed.  In general there may be thousands of events
associated with a person's calendar.

      Furthermore, the Busy Bar is a graphical user interface control
implemented in Windows, PM, or X Windows with associated vertical
Scroll Bars.  The data points which make up the blocks must be
calculated in sub-second time intervals to allow for smooth
scrolling.

      If the users event list is a couple of dozen entries long, this
presents no problem -- simply walk each element of the list whenever
a paint message is received and plot the points on the fly -- and
hope the user doesn't mind the slight delay in response.

      If the users event list is in the hundreds, there is a
noticeable lag in performance.  When the event list numbers in the
thousands, the delay is intolerable, and the appearance of the
control is extremely unprofessional.

      The solution presented here is to preprocess the data keeping
it in a form which is specifically oriented to the Busy Bar.  A Bit
Vector is calculated and stored in the instance data of the Busy Bar
where each bit represents a five minute interval on a single day.  To
represent a week, an array of:

24 hours * 12 intervals per hour = 288 bytes
is required.

      A dirty bit is maintained by the instance data of the BusyBar.
Whenever a PAINT message is sent to the BusyBar, the dirty bit is
tested.  If the bit is set, the bit vector is calculated:

   static VOID BcCalcTypeBitVector(PBBCD pCd)
   {
     LLIST *    pLL;
     PEVENT     pE;
     SHORT      start;
     SHORT      stop;
     SHORT      i;
    ...