Skip to content. | Skip to navigation

Sections
Personal tools
You are here: Home Accelerate Tutorials Travels with Mark: A Hitchhiker's Guide to the UniVerse, Part 6: File Opens – The Cost

Travels with Mark: A Hitchhiker's Guide to the UniVerse, Part 6

Page 1 of 15 Go to the next page

File Opens – The Cost

Opening Pandora's file

Level: Intermediate

Mark Baldridge ( mbaldridge@rs.com), Principal Consultant, Rocket Software

13 Nov 2008

In this installment of the UniVerse performance series, explore the cost of opening files in BASIC programs. Measure opening simple hash files, dynamic files, and directory files, and measure the impact of adding indices to files. Time open distributed files, with and without indices, and examine variations by looking at OPENSEQ and OPENPATH.

Before you start

This tutorial builds upon the first tutorial, which introduced the UniVerse Profiler for building unit performance tests. Even if you do not delve into the statistics, a fundamental understanding of the Profiler's capabilities should prove crucial. The Profiler comes as an unmodified Ideal flavor account, which uses a mixture of Information, Pick, and Reality style syntaxes for different commands and code. You can use any flavor of account, adjusting code for different command syntax by adding VOC entries to provide syntax-compatible commands such as CREATE.FILE, or by using routines to hide the flavor differences. Tests that examine the difference in performance of flavor-specific behavior control that behavior with $OPTIONS compiler directives.

Code examples use mixed case, or camel-back, variable names with an initial capital letter. Language constructs and keywords use lower case. The LOGIN paragraph turns off case inversion. The program, Keywords, in the Bp file copies all of the keywords and the VOC file pointer to their lower case counterparts if you want to set up your own account.

Before you start building and running tests, you should enter the Profiler account, execute UPDATE.ACCOUNT, and the BuildAll paragraph, then rerun the LOGIN paragraph to turn off case inversion. If you have any platform- or release-specific differences in your environment, this should properly initialize them.

If UniVerse emits messages resembling Listing 1 upon starting, the files and BASIC object code do not match the byte order of the target server. Simply run fnuxi * in the directory containing the VOC file.

$ uv  
Byte-swapped magic number in operating system file "VOC", use "fnuxi VOC" to convert.
Byte-swapped magic number in operating system file "VOC", use "fnuxi VOC" to convert.
Byte-swapped magic number in operating system file "VOC", use "fnuxi VOC" to convert.
Byte-swapped magic number in operating system file "VOC", use "fnuxi VOC" to convert.
This directory is not set up for uniVerse.
Would you like to set it up (Y/N)?N

$ fnuxi *
 

About this series

This series of tutorials provides UniVerse DBAs and application designers with tools for making reasoned and metrically-justified decisions about choices in everyday tasks. The subject matter of this series on UniVerse performance tuning arises from visits to customer sites. The issues raised do not disparage the customer, but reflect a real-world predicament. The typical developer or DBA has so many outstanding tasks that by the time one task is complete, at least one more has joined those remaining. They all demand attention. Sufficient time exists to make something work, but typically not enough to make it work well.


 


About this tutorial

With this installment, explore the cost of opening files. Measure opening simple hash files, dynamic files, and directory files, and measure the impact of adding indices to files. Time open distributed files, with and without indices, and examine variations by looking at OPENSEQ and OPENPATH.


 


Objectives

In this tutorial, contrast the expense of opening files in different configurations, in preparation for exploring ways to avoid them.


 


Prerequisites

This tutorial requires an installation of UniVerse. You can download a Personal Edition of UniVerse for Linux or Windows. The Personal Edition has file size restrictions that prohibit running some tests, such as test 1332, which creates a 1GB file. These tests contain B in field 6. Changing the B to a T allows these tests to build and run. You should have a familiarity with writing and compiling UniVerse BASIC programs.

 

Page 1 of 15 Go to the next page
Document Actions