I think javascript levels are faster than kml. (The fastest speed is to create graphic tiles - but it takes a lot of time and needs to be done statically).
I would use AJAX to generate data on the server and send it to the API on the fly.
I think KML is useful if you want to share data with other websites and people using GIS desktop software. It is very simple to use a different KML layer. Their javascript array is much more complicated.
source share