perf optimization javascript front end index.js