Browse Prior Art Database

Performance-Oriented Menu Caching for Dynamically Built Menus

IP.com Disclosure Number: IPCOM000111900D
Original Publication Date: 1994-Apr-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 79K

Publishing Venue

IBM

Related People

Malcolm, JW: AUTHOR [+2]

Abstract

In an application like LAN NetView*, objects can be represented as icons within a folder. Each icon has its related pop-up context menu, as does the folder itself. In most applications, these context menus are predefined and displayed using the WinPopupMenu API.

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

Performance-Oriented Menu Caching for Dynamically Built Menus

      In an application like LAN NetView*, objects can be represented
as icons within a folder.  Each icon has its related pop-up context
menu, as does the folder itself.  In most applications, these context
menus are predefined and displayed using the WinPopupMenu API.

      In LAN NetView, however, these menus are required to be built
dynamically at runtime.  One reason this is needed is because other
applications can register new menu items which need to be displayed
along with the standard menu items that LAN NetView provides.
Predefined menus can therefore not be used.

      While building menus dynamically at runtime provides great
flexibility in what menu items the menus contain, it does bring with
it a performance penalty.  It takes significantly longer to determine
what menu items are needed, and to then build the proper structures
to create the menu, than it does to simply use a predefined menu.
This disclosure discusses a method that retains this required menu
creation flexibility while minimizing the inherent performance
penalty that it entails.

      The main performance penalties in creating menus dynamically at
runtime are incurred in the determination of what menu items are
needed on the menu, and the subsequent construction of the menu
structures needed to create the menu that is displayed.  Once the
structures have been created, the actual menu creation is quite fast.

      The key to performance is therefore to minimize the number of
times that the menu needs to be reconstructed from scratch, and,
instead, to use previously created, cached menu structures to create
the menu.

      This can be done by caching the created menu structures in an
external file on disk, such as an INI file.  When the menu is
requested to be displayed, the object first looks to the INI file to
see if it has previously been created and stored.  If it is not found
in the INI file, then it must be created from scratch, with the
inherent performance penalty.  It is then written to the INI file so
it will be available the next time the o...