Previous: Classic File Format Performance Next: NetCDF Classic Performance Tips Table of contents Frames 2012 Unidata NetCDF Workshop > Formats and Performance

14.3 Benchmark Example
Comparison of algorithms to process all netCDF data through netCDF APIs, implemented two ways.

Consider implementing a program to just copy data.

$ nccopy   input_file   output_file
  1.     create empty output file
        add dimensions and global attributes in input to output
      
        for each variable in the input file
             add the variable definition to the output file
             copy the variable's attributes to output
             copy the variable's data to the output
      
  2.     create empty output file
        add dimensions and global attributes to output
      
        for each variable in the input file
            add the variable definition to the output file
            copy the variable's attributes to output
      
        for each variable in the input file
            copy the variable's data to the output
      

If output is a classic netCDF file, which method is faster, and why? If the input has record variables, can the faster algorithm be improved?

For HDF5-based netCDF-4 files, schema changes such as adding new variables are efficient, because both metadata and data can be appended to a netCDF-4 file.

 


Previous: Classic File Format Performance Next: NetCDF Classic Performance Tips Table of contents Frames 2012 Unidata NetCDF Workshop > Formats and Performance