With those lines from sebastian I played around. I think, the following lines show the answer to my question.
In words - even with zeroing the space the result is fast.
With my current application I tested four different scenarios:
plhs[0] = mxCreateNumericArray(targetDimCount, targetDims, targetClass, mxREAL);
plhs[0] = mxCreateNumericArray(0, 0, targetClass, mxREAL); mxSetData(plhs[0],mxMalloc(destLen_in_Bytes));
plhs[0] = mxCreateNumericArray(0, 0, targetClass, mxREAL); mxSetData(plhs[0],mxRealloc(mxGetData(plhs[0]),destLen_in_Bytes));
plhs[0] = mxCreateUninitNumericArray(targetDimCount, targetDims, targetClass, mxREAL);
resulting in those timings (for allocated matrices of size given in column one)
size time 1 time 2 time 3 time 4
1000 0.037401 0.037263 0.039294 0.037628
2000 0.14906 0.14937 0.15278 0.14917
3000 0.33497 0.33449 0.34601 0.33749
4000 0.61207 0.60546 0.61563 0.60086
5000 0.94057 0.93076 0.96147 0.95723
6000 1.3497 1.3475 1.3794 1.3559
7000 1.837 1.8265 1.8776 1.846
8000 2.398 2.3893 2.4625 2.3885
9000 3.0264 3.047 3.1374 3.0339
10000 3.7658 3.7677 3.8392 3.7862
20000 15.208 14.968 15.404 15.143
30000 13.583 13.58 13.955 13.648
50000 13.291 13.236 13.535 13.478
With a view on these numbers, my opinion is, that reallocating is a bad idea (but not so bad, as the timing shows) and zeroing the values is not a very big efford. Okay - one can further wonder on the behaviour between 10000 to 30000 - but that would be more scientific. Using malloc (only for testing purposes) is not working, as the allocated storage needs to be for a plhs - and it crashes unless the storage is allocated by mx***