He Steven,
I use HighFive wrapper, Windows 10 x64, MSVC x64, Qt, Release built, HDF5 1.12.0, C-language library
First of all I noticed that I can’t create attribute with more than 16366 float numbers (65 464 bytes).
I also can’tcreate two attributes to one dataset with 16366 float numbers.
Then in my experiment I create dataset and write data (16366 float numbers) there in loop and measure average time to do 100 such loops. It takes 0.039 milliseconds
Then to each of these dataset I create and write attribute (16366 float numbers) in loop (also 100 loops). The average time is 0.255 milliseconds
But here is one important thing that I can’t understand.
My code takes less time to create 100 datasets (attributes) than creating only one of them.
Here is my code:
#include <QString>
#include <QList>
#include <H5File.hpp>
#include <H5Group.hpp>
#include <H5DataSet.hpp>
#include <H5DataSpace.hpp>
#include <H5Attribute.hpp>
#include <armadillo>
using namespace arma;
using namespace HighFive;
int main(void)
{
File file("names.h5", File::ReadWrite | File::Create | File::Truncate);
Group group = file.createGroup("group");
wall_clock timer;
size_t N = 16366;
vec data(N, fill::randu);
int I = 1;
vec datasetTime(I);
QList<DataSet> datasetList;
for (int i = 0; i < I; i++){
timer.tic();
DataSet dataset = group.createDataSet<float>(std::to_string(i), DataSpace({N}));
datasetTime(i) = timer.toc();
datasetList.push_back(dataset);
}
vec attrTime(I);
for (int i = 0; i < I; i++){
timer.tic();
datasetList[i].createAttribute<float>("Attr", DataSpace({N})).write((float*)data.memptr());
attrTime(i) = timer.toc();
}
std::cout << mean(datasetTime) << std::endl;
std::cout << mean(attrTime) << std::endl;
file.flush();
}
To create 100 such datasets and write data it takes 0.039 milliseconds
To create 1 dataset and write data it takes 0.173 milliseconds
To create 100 such attributes and write data it takes 0.255 milliseconds
To create 1 attribute and write data it takes 0.158 milliseconds
I don’t understand why this happens 
Here is the screenshot of HdfViewer: