I've noticed some performance issues with my javascript code. After some profiling and investigations I discovered that the Munchkin javascript code hangs for a long time (200+ ms) on every call to Munchkin.munchkinFunction(). This is because the Munchkin code sends a SYNCHRONOUS XMLHttpRequest, as you can see in the following snippet taken from http://munchkin.marketo.net/147/munchkin.js.
a=new XMLHttpRequest;a.open("GET",b,!1);
Moreover, many calls to 'Munchkin.munchkinFunction' are done in inside UI event handlers, for example a click on a button. Even when a timeout is provided, the sync call still needs at least 200ms to complete. These are 200ms in which the UI hangs. Even such small hangs lead to leggy CSS transitions, interrupt to implement a responsive UI, and hurt the overall user experience.
Instead of forcing all the requests to be synchronous, a better solution in my opinion will be to add a flag to the 'Munchkin.munchkinFunction' function that allows to choose between sync or async call.