3 ms·
Both options there feel like the wrong solution. Why would you call the constructor 100 times to popuate 100 4-byte arrays? It's a service, surely the best ap
by eterm 8y ago
Both options there feel like the wrong solution.
Why would you call the constructor 100 times to popuate 100 4-byte arrays?
It's a service, surely the best approach to call the constructor once, then populate 100 4-byte arrays by calling GetBytes 100 times from the same service?
It is explicit code without the downside of the expensive constructor.
edit for clarification: It's true that getting all the data at once will still be much faster because it'll save all the other overhead, but it's not the constructor at fault there.