C# HDF.PInvoke performance problem

Dear support,

I am currently sitting with a performance problem reading data from an HDF. I have currently
Over 2mil cells in one file, but it takes about 5 seconds to read the information. Is there a way
Where reading data from C# HDF.PInvoke can be optimized ?

I have attached my Code

Regards

Johan Ferguson

Program.cs (4.4 KB)

Johan, how are you? I'm not sure I understand what you trying to achieve
here. Presumably you are reading a dataset (2D) of single precision
floating point numbers. What's the layout of the dataset?

Have you timed the H5D.read call on line 116? How long does that take?
(Unless the layout of your data is "strange", e.g., chunked with
one element per chunk, this should be fast, except you are reading
off a floppy disk :wink:

Then you are looping (lines 121-128) over the float array and read the
elements byte by byte. (?) Maybe that's the long pole in the tent (in your timing)?

G.

ยทยทยท

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of Johan Ferguson
Sent: Tuesday, March 07, 2017 1:28 AM
To: hdf-forum@lists.hdfgroup.org
Cc: HDF Helpdesk <help@hdfgroup.org>
Subject: [Hdf-forum] C# HDF.PInvoke performance problem

Dear support,

I am currently sitting with a performance problem reading data from an HDF. I have currently
Over 2mil cells in one file, but it takes about 5 seconds to read the information. Is there a way
Where reading data from C# HDF.PInvoke can be optimized ?

I have attached my Code

Regards

Johan Ferguson