I am generating randomized string sequences from a 4 different arrays containing up to 700 strings each and now I'm worrying about the performance.
Are there any easy ways to improve perfomance of a static site like this, where you have single jquery click listener and it's randomly creating sentences based on the strings
var first = [700_ITEMS]
var sec = [400_ITEMS]
$(document).ready(function() {
$('#generate button').click(function(){
$('#slide1 h1').html(first[Math.floor(Math.random() * first.length)]+" "+sec[Math.floor(Math.random() * sec.length)]);
})
});
Maybe I can read the strings somehow on the fly?