4 ms·
What's the benefit over just allocating the worst case size? If worst case size is too large, your program is broken anyway on some of your inputs.
by Peaker 11y ago
What's the benefit over just allocating the worst case size? If worst case size is too large, your program is broken anyway on some of your inputs.
- bluecalm 11y agoIn my current project I get a significant (about 3%) performance difference when I change my VLAs to allocating the biggest possible size. My guess is that it's because cache implications (a lot of useless 0s occupy a cache when you allocate a lot of useless space on the stack) but I haven't investigated it too deeply, just measured it.