Reg vs const for arrays
-
I need to store some data in arrays. Which has faster access time from the MIDI callbacks,
reg
orconst
?Currently I'm using
const
with thereserve
command for the number of elements I'm using. -
I've made this little benchmark snippet a while ago, you can adapt it to your needs
HiseSnippet 963.3ocsV01aaaCDlxIpnRcaXEn+.D5mbPKxric8JpWwpiiSgQyKF1dAansqfkhNlHTjFTzcyXn+m2+fsi5EKpDam.iT8ACeO2cjO7QG0cCTRBMNVpPNdiWLihb9N2QKD5ocmhYBT+iPN+f6o3XMUEjBc3hY33XZHxwYm2Z.b71Ek77u+5gXNVPnEPHzERFgdBKhoKPG7l2w37iwgzwrHqna9l9DonqjKmC7YG2ZnYXxU3KomgMgUwE47fdgLsTMRi0zXjytGJCWLZp7uDoweAKl8YN0XTGMBVnT3ik7PCiMnntSY7vA4m6XDrJCJTgcRUgm3dJKjsDuPM9wDGAEYXqGNUJSucJQu51zqlE8VAkbrnztoT5wtiHJ1LcgGCedjaeA7xYBFjcapjFKpxe9.2tRHBgd+H7UziUfwxLp1pVsmG.+rWaeHpXImtOgSwpp.fuhdY.bLz0CdcPs8q0NAHFNdvajkXKi5..48.zGKEmEpO7tMVG7ErJI9FEdJbjkkkO+73aluiVwsDyZI5Ot2vNi6e9Yi.m0qk7.Aje7loXBc0m9AwGDC681WE7TqidrFqzGREjoQX0UFMXhTETk855sCX+RwBCVO6Y64+O9d4xyoX8z84xKqx16mNvPHOKcJIn19e0ZejyJsM9qieAcFNryebevxCdesOtIhl4OOzsftcg8bbvEcFd+Q5F2BoaTP5FaGoA5dePzlahkMynXyaieLAmInASlKHZlTjjzIRBlWMYi3l+l.9h759LrrMZIru2FIsGrXd4qyMosm0xkDEf8Uf5qR+N47tcN41TPqyQ6MI.q872QovKttHzp3iDkkAKG2Ugn05Jzx0hVEUZsRpz1rhb2tBb8y25EmkRhTblTSOWjJF.EBttqISVoOSS.kjyopU51zHVsoDqJlG8Yp54v2X4yoKCD5NUtkm65a4Y2Qlj1SxJPonufoOeFUrt9znrFYv+9s9Gg0XSexLLHtYTklYnfyQzu.Ccj10zy8HZ7UfbBicbiVpPybY3bNVWtCuYrlLGfFTpspo0oHloWXO1y8Va+6JEer6.llLc0brxJ3HnTeK3X1vReuauISnDcAA2083e+ayjQngx4Zl3R3pph82P81YyiFAyKRnvtKDTtoFzohoZI0tlw1n.inhvDi+CdxbV2X6j4rdtSTDlnjehjV4aFG6gIH.mDISh5AiDC1A0QI2Fr04HX5vOQHkWpaj3AaahM11DatsI9hsMwVaah+71l3Ku8DMCu2YtVFkdsAgNcPujOk33zSfgJvjpUz+CPmELn
-
@ustk This is great.
@d-healey Unless you'll be calling it hundreds of times per callback, the speed differences seem to be insignificant.
Also, consider a MIDI List
https://docs.hise.audio/scripting/scripting-api/midilist/index.html -
@aaronventure Yeah I'm using MIDI lists where I can. Greg's demo only applies to the on init callback, I'll need to modify it for MIDI callbacks but I suspect the same results.