What's a good test to compare performance of different Ajax frameworks?
I want to compare the performance of different PHP/Ajax frameworks. I'm not looking for tools to run the tests, I'm looking for what tests to run. I'm in the design phase of a project so I don't have an existing app.
I'd like to build the same page in several differe开发者_JAVA百科nt frameworks and compare things like the generated client-side code and amount of data included in the Ajax requests. I'm wondering what functionality to build in my sample page that will give a good comparison.
Hope this makes sense, feel free to edit if it could be more clear.
The only way to benchmark something is to use it in a real world scenario, then wrap this code around it
// header
list ($_time_start_msec, $_time_start_sec) = split (" ", microtime());
$_time_start = $_time_start_sec + $_time_start_msec;
//<!-- APP HERE -->
// footer
list ($_time_finish_msec, $_time_finish_sec) = split (" ", microtime());
$_total_secs = ($_time_finish_sec + $_time_finish_msec) - $_time_start;
print '<p><small>This entire page took '. round($_total_secs, 5) .' seconds to render, which gives us '. round((1 / $_total_secs), 1) .' <span title="Pages Per Second">PPS</span> or '. number_format((1 / $_total_secs * 60), ".", 0, ",") .' <span title="Pages Per Minute">PPM</span>.</small></p>';
精彩评论