fastest between hook_js vs hook_menu to get JSON via REST I'm trying to figure out if in my case it makes sense to use the High-performance JavaScript callback handler module.
Between js/MODULE/example.json (hook_js()) and example.json (hook_menu()), the difference of time is not huge, but I think hook_js() is faster.

In a case I'm not using any Drupal function, variable or session, and I'm only calling another server with REST. Can I bypass all the bootstrap functions, or do I have to use the first layer (DRUPAL_BOOTSTRAP_CONFIGURATION)?

What would be the faster solution? 

function MODULE_js(){
    return array(
      // Example URL is /js/MODULE/example.json
      'example.json' =&gt; array(
        'callback' =&gt; 'my_json',
        'includes' =&gt; array('unicode', 'locale', 'language'),
        'dependencies' =&gt; array(),
        'bootstrap' =&gt; DRUPAL_BOOTSTRAP_CONFIGURATION,
        'access callback' =&gt; 'access_callback',
        'access arguments' =&gt; array(),
        'page arguments' =&gt; array(),
        'skip_hook_init' =&gt; TRUE,
        'delivery callback' =&gt; 'drupal_json_output',
      ),
    );
}
function access_callback (){
    return true;
}


function MODULE_menu()
    $items['example.json'] = array(
        'type' =&gt; MENU_CALLBACK,
        'page callback' =&gt; 'my_json',
        'page arguments' =&gt; array(),
        'access callback' =&gt; true,
        'delivery callback' =&gt; 'drupal_json_output',
    );
return $items;
}

function my_json(){
    //call with curl/rest and return a json
    return 'json';
}
Actually, as the project documentation says, you should use http://example.com/js.php?q=js/mymodule/callback instead of http://example.com/index.php?q=js/mymodule/callback, and basing on the test reported from the maintainer, the previous is faster than the latter (59.371 ms per request versus 446.846 ms per request). Since you are waiting a reply from another server, probably you would not notice that difference too.

For you second question, if you are going to use the High-performance JavaScript callback handler module in the way shown in the documentation, js.php bootstraps Drupal at DRUPAL_BOOTSTRAP_DATABASE level. In any case, if you are not using any Drupal function nor the session, and you are using just plain PHP functions or classes, then you don't need to bootstrap Drupal at all. Keep in mind that this means you cannot use any function implemented by Drupal modules too.