Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.
/ sanic Public archive

A fast coroutine generator that saves your memory.

License

Notifications You must be signed in to change notification settings

notaurieh/sanic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sanic - a coroutine wrapper

Build Status

const sanic = require("sanic");
var fn = sanic(function* () {
  try {
    const response = yield makeAWebRequest();
    console.log(response.body);
  } catch (e) {
    console.error("Wooops\n", e);
  }
});

fn();

Just like that, did I mention its fast? How fast, you may ask.. Well

sanic x 503,384 ops/sec ±0.60% (84 runs sampled)
babel x 450,866 ops/sec ±0.50% (88 runs sampled)
typescript x 436,633 ops/sec ±2.27% (83 runs sampled)
bluebird.coroutine x 7,969 ops/sec ±1.15% (84 runs sampled)
co.wrap x 386,493 ops/sec ±0.79% (83 runs sampled)
q.async x 25,756 ops/sec ±3.14% (79 runs sampled)
asyncawait x 159,716 ops/sec ±1.17% (85 runs sampled)
Fastest is sanic

And all that for a fraction of memory (benchmark runs used ~20MB, for sanic)

About

A fast coroutine generator that saves your memory.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages