build-plus-exec.benchmark.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2. // NOTE:
  3. // Commented out this file because it's not as telling
  4. // as looking at the methods' performance individually.
  5. // (And it adds a bunch of time to the benchmark test run...)
  6. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7. // /**
  8. // * Module dependencies
  9. // */
  10. // var runBenchmarks = require('../util/run-benchmarks.helper');
  11. // var Machine = require('../../');
  12. // /* eslint-disable no-unused-vars, camelcase */
  13. // // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14. // // ^^because the snake_case makes test output more readable when working with
  15. // // the benchmark.js lib, and the unused vars are there on purpose (to help
  16. // // make sure that nothing gets optimized away by V8).
  17. // // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  18. // // ╔═╗╦═╗ ╦╔╦╗╦ ╦╦═╗╔═╗╔═╗
  19. // // ╠╣ ║╔╩╦╝ ║ ║ ║╠╦╝║╣ ╚═╗
  20. // // ╚ ╩╩ ╚═ ╩ ╚═╝╩╚═╚═╝╚═╝
  21. // var DO_SOMETHING_VERY_SIMPLE = require('./private/do-something-very-simple.fixture');
  22. // var DO_SOMETHING_NORMAL = require('./private/do-something-normal.fixture');
  23. // var DO_SOMETHING_NORMAL_WITH_COMPLEX_EXEMPLARS = require('./private/do-something-normal-with-complex-exemplars.fixture');
  24. // var DO_SOMETHING_INSANE_WITH_MANY_BASIC_EXEMPLARS = require('./private/do-something-insane-with-many-basic-exemplars.fixture');
  25. // var DO_SOMETHING_INSANE_BUT_CACHEABLE_WITH_MANY_BASIC_EXEMPLARS = require('./private/do-something-insane-but-cacheable-with-many-basic-exemplars.fixture');
  26. // var DO_SOMETHING_INSANE_WITH_MANY_COMPLEX_EXEMPLARS = require('./private/do-something-insane-with-many-complex-exemplars.fixture');
  27. // var DO_SOMETHING_INSANE_WITH_MANY_REF_EXEMPLARS = require('./private/do-something-insane-with-many-ref-exemplars.fixture');
  28. // var SAMPLE_USERS = require('./private/sample-users.fixture');
  29. // var SAMPLE_SPECIES = require('./private/sample-species.fixture');
  30. // var SAMPLE_MANY_BASIC_ARGINS = require('./private/sample-many-basic-argins.fixture');
  31. // var SAMPLE_MANY_COMPLEX_ARGINS = require('./private/sample-many-complex-argins.fixture');
  32. // // ╔╗ ╔═╗╔╗╔╔═╗╦ ╦╔╦╗╔═╗╦═╗╦╔═╔═╗
  33. // // ╠╩╗║╣ ║║║║ ╠═╣║║║╠═╣╠╦╝╠╩╗╚═╗
  34. // // ╚═╝╚═╝╝╚╝╚═╝╩ ╩╩ ╩╩ ╩╩╚═╩ ╩╚═╝
  35. // describe('benchmark :: Machine.build() + .exec()', function (){
  36. // // Set "timeout" and "slow" thresholds incredibly high
  37. // // to avoid running into issues.
  38. // this.slow(240000);
  39. // this.timeout(240000);
  40. // it('should be performant enough', function (done){
  41. // runBenchmarks('.build() + .exec()', [
  42. // function sanity_check(next){
  43. // // Do nothing.
  44. // return next();
  45. // },
  46. // function build_and_exec_very_simple_machine(next){
  47. // var m = Machine.build(DO_SOMETHING_VERY_SIMPLE);
  48. // m({}).exec(next);
  49. // },
  50. // function build_and_exec_machine_with_inputs_and_exits_but_nothing_crazy(next){
  51. // var m = Machine.build(DO_SOMETHING_NORMAL);
  52. // m({
  53. // flavor: 'Sadness',
  54. // qty: 1000,
  55. // foo: 'wha',
  56. // bar: 'huh?'
  57. // }).exec(next);
  58. // },
  59. // function build_and_exec_machine_with_inputs_and_exits_that_have_big_ole_exemplars(next){
  60. // var m = Machine.build(DO_SOMETHING_NORMAL_WITH_COMPLEX_EXEMPLARS);
  61. // m({
  62. // // Note:
  63. // // > We just abritarily use samples from the exemplars as argmts so this
  64. // // > benchmark is easier to read.
  65. // users: SAMPLE_USERS,
  66. // availableSpecies: SAMPLE_SPECIES,
  67. // foo: SAMPLE_USERS,
  68. // bar: SAMPLE_USERS
  69. // }).exec(next);
  70. // },
  71. // function build_and_exec_machine_with_crazy_numbers_of_inputs_and_exits(next){
  72. // var m = Machine.build(DO_SOMETHING_INSANE_WITH_MANY_BASIC_EXEMPLARS);
  73. // m(SAMPLE_MANY_BASIC_ARGINS).exec(next);
  74. // },
  75. // function build_and_exec_machine_with_crazy_numbers_of_inputs_and_exits_and_is_cacheable(next){
  76. // var m = Machine.build(DO_SOMETHING_INSANE_BUT_CACHEABLE_WITH_MANY_BASIC_EXEMPLARS);
  77. // m(SAMPLE_MANY_BASIC_ARGINS).exec(next);
  78. // },
  79. // function build_and_exec_machine_with_crazy_numbers_of_inputs_and_exits_with_huge_exemplars(next){
  80. // var m = Machine.build(DO_SOMETHING_INSANE_WITH_MANY_COMPLEX_EXEMPLARS);
  81. // m(SAMPLE_MANY_COMPLEX_ARGINS).exec(next);
  82. // },
  83. // function build_and_exec_machine_with_crazy_numbers_of_inputs_and_exits_with_ref_exemplars(next){
  84. // var m = Machine.build(DO_SOMETHING_INSANE_WITH_MANY_REF_EXEMPLARS);
  85. // m(SAMPLE_MANY_COMPLEX_ARGINS).exec(next);
  86. // },
  87. // ], done);
  88. // });//</should be performant enough>
  89. // });