GithubHelp home page GithubHelp logo

haoliangyu / fachi Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 657 KB

fachi is a modern benchmark runner for JavaScript and TypeScript

License: MIT License

JavaScript 8.48% Batchfile 0.44% TypeScript 91.08%

fachi's People

Contributors

haoliangyu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

fachi's Issues

Planning

  • Error handling: the test case should fail on error but the hook should still run (#2)
  • suite vs test:
    • Suite should run tests, logging (#3), and handle errors.
    • Test should handle the underline benchmark framework.
  • Typings
  • Documentations

Error isolation and handling

A typical test file in fachi may contain multiple test suites and each test suite may contain test cases.

suite('search', function () {
  before(function () {
    // ...
  })

  after(function () {
    // ...
  })

  bench('by id', function () {
    // ...
  });
})

In the hierarchy, file -> suite -> test, items in each level are separate, and the execution result of a file/suite/test doesn't affect others in the same level. This provides the isolation mechanism in error situations, for example,

  • the syntax error in a test file should not affect the execution of a second file,
  • the file I/O in a]the suite before hook should not affect the execution of another suite in the same file,
  • the error from a bug in a test case should not affect the execution of another test in the same suite.

The emergent error in a file pauses the execution of that file. So as the suite (hooks) and the test cases. After printing the error message, then it should move on to run the next file until all are done.

Logging

When the CLI tool runs, it should print out the log messages for each file, suite, and case. The format should look like

/my-project/benchmarks/search.js

  search
    * by id x 4,161,532 +-0.99% (59 cycles)
    * by name x 4,231,578 +-0.89% (56 cycles)

  search-string
    * by org x 5,234,786 +-0.95% (73 cycles)

The logging logic should be wrapped into a Logger class.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.