Customer report:
"I want a small command line tool to grab a spectrum - this is dead easy of course. The problem is that the API is rather slow in starting up - and if I go onto use my commandline tool in another script in a loop
95% of my time is spent in openSpectrometer.
"Using valgrind / callgrind I can see that the reason that this takes so long is because openSpectrometer calls DeviceFactory 17 times in order to iterate over every type of spectrometer you make. I wondered if I could shortcut this by only trying to open the one type of spectrometer I have connected and check out demo-named-spectrometer, however this simply calls openSpectrometer as before (iterating 17 times through DeviceFactory) and then iterates through the known types to look for a match.
"So my question is, is there a way to simply open a specific type and then avoid the iteration? My suggestion is (assuming there isn't a way to do this) - could you provide an overloaded openSpectrometer which only tries a specific model?"
Update:
"I lashed up a single device call in the library and while it the opening % has dropped to ~30% and the overall savings are about 1/3 of the execution time the savings weren't as big as I'd hoped because I'd factored out the contribution of the library load which dents the potential savings.
"So it would be a nice rather than significant feature!"