It takes 40s because your requests are being processed in a synchronous way.

I get that, but even so it's awfully slow. The same thing written in node.js using node-rest-client like this:

var Client = require('node-rest-client').Client; 
var client = new Client();

function doRequest(i)
{
    if (i%50 == 0) console.log(i);
    
    if (i < 1000) client.get("the same url", function(data, response){
        console.log(response);
        doRequest(i + 1);
    });
}

doRequest(0);

manages to do the same work in three to four seconds. And yes, it works synchronously as well.

Never, EVER, do heavy lifting in the module ctor (static this / shared static this). All it is for is listenHTTP / setTimer / runTask and friends.

Yes, I should have ran the test with runTask. Although that has no effect on the performance.

Regarding your memory problem, are you sure it's hard memory usage, and not just virtual ? By default each task (fiber) allocate some space, most of which will be unused (each one will/should basically be a page).
If it's hard memory, my guess is that the delegates are allocated. Try to make them functions and see if that improves things.

It is hard memory, but that's to be expected with a thousand tasks. Ultimately it doesn't really matter, as this is just a test. What matters is that requestHTTP takes a very long time.

By the way, I just noticed that when I do an HTTP request to a server like google.com, I get the following:

Task terminated with uncaught exception: Failed to lookup host 'google.com': nodename nor servname provided, or not known

What's up with that?