build-plus-execSync.benchmark.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 _ = require('@sailshq/lodash');
  11. // var runBenchmarks = require('../util/run-benchmarks.helper');
  12. // var Machine = require('../../');
  13. // /* eslint-disable no-unused-vars, camelcase */
  14. // // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  15. // // ^^because the snake_case makes test output more readable when working with
  16. // // the benchmark.js lib, and the unused vars are there on purpose (to help
  17. // // make sure that nothing gets optimized away by V8).
  18. // // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  19. // // ╔═╗╦═╗ ╦╔╦╗╦ ╦╦═╗╔═╗╔═╗
  20. // // ╠╣ ║╔╩╦╝ ║ ║ ║╠╦╝║╣ ╚═╗
  21. // // ╚ ╩╩ ╚═ ╩ ╚═╝╩╚═╚═╝╚═╝
  22. // // > Note that we extend all of the test machine defs with `sync: true`--
  23. // // > a necessary step, given the nature of this particular benchmark.
  24. // var DO_SOMETHING_VERY_SIMPLE = _.extend({sync: true}, require('./private/do-something-very-simple.fixture'));
  25. // var DO_SOMETHING_NORMAL = _.extend({sync: true}, require('./private/do-something-normal.fixture'));
  26. // var DO_SOMETHING_NORMAL_WITH_COMPLEX_EXEMPLARS = _.extend({sync: true}, require('./private/do-something-normal-with-complex-exemplars.fixture'));
  27. // var DO_SOMETHING_INSANE_WITH_MANY_BASIC_EXEMPLARS = _.extend({sync: true}, require('./private/do-something-insane-with-many-basic-exemplars.fixture'));
  28. // var DO_SOMETHING_INSANE_BUT_CACHEABLE_WITH_MANY_BASIC_EXEMPLARS = _.extend({sync: true}, require('./private/do-something-insane-but-cacheable-with-many-basic-exemplars.fixture'));
  29. // var DO_SOMETHING_INSANE_WITH_MANY_COMPLEX_EXEMPLARS = _.extend({sync: true}, require('./private/do-something-insane-with-many-complex-exemplars.fixture'));
  30. // var DO_SOMETHING_INSANE_WITH_MANY_REF_EXEMPLARS = _.extend({sync: true}, require('./private/do-something-insane-with-many-ref-exemplars.fixture'));
  31. // var SAMPLE_USERS = require('./private/sample-users.fixture');
  32. // var SAMPLE_SPECIES = require('./private/sample-species.fixture');
  33. // var SAMPLE_MANY_BASIC_ARGINS = require('./private/sample-many-basic-argins.fixture');
  34. // var SAMPLE_MANY_COMPLEX_ARGINS = require('./private/sample-many-complex-argins.fixture');
  35. // // ╔╗ ╔═╗╔╗╔╔═╗╦ ╦╔╦╗╔═╗╦═╗╦╔═╔═╗
  36. // // ╠╩╗║╣ ║║║║ ╠═╣║║║╠═╣╠╦╝╠╩╗╚═╗
  37. // // ╚═╝╚═╝╝╚╝╚═╝╩ ╩╩ ╩╩ ╩╩╚═╩ ╩╚═╝
  38. // describe('benchmark :: Machine.build() + .execSync()', function (){
  39. // // Set "timeout" and "slow" thresholds incredibly high
  40. // // to avoid running into issues.
  41. // this.slow(240000);
  42. // this.timeout(240000);
  43. // it('should be performant enough', function (done){
  44. // runBenchmarks('.build() + .execSync()', [
  45. // function sanity_check(next){
  46. // // Do nothing.
  47. // return next();
  48. // },
  49. // function build_and_execSync_very_simple_machine(next){
  50. // var m = Machine.build(DO_SOMETHING_VERY_SIMPLE);
  51. // m({}).execSync();
  52. // return next();
  53. // },
  54. // function build_and_execSync_machine_with_inputs_and_exits_but_nothing_crazy(next){
  55. // var m = Machine.build(DO_SOMETHING_NORMAL);
  56. // m({
  57. // flavor: 'Sadness',
  58. // qty: 1000,
  59. // foo: 'wha',
  60. // bar: 'huh?'
  61. // }).execSync();
  62. // return next();
  63. // },
  64. // function build_and_execSync_machine_with_inputs_and_exits_that_have_big_ole_exemplars(next){
  65. // var m = Machine.build(DO_SOMETHING_NORMAL_WITH_COMPLEX_EXEMPLARS);
  66. // m({
  67. // // Note:
  68. // // > We just abritarily use samples from the exemplars as argmts so this
  69. // // > benchmark is easier to read.
  70. // users: SAMPLE_USERS,
  71. // availableSpecies: SAMPLE_SPECIES,
  72. // foo: SAMPLE_USERS,
  73. // bar: SAMPLE_USERS
  74. // }).execSync();
  75. // return next();
  76. // },
  77. // function build_and_execSync_machine_with_crazy_numbers_of_inputs_and_exits(next){
  78. // var m = Machine.build(DO_SOMETHING_INSANE_WITH_MANY_BASIC_EXEMPLARS);
  79. // m(SAMPLE_MANY_BASIC_ARGINS).execSync();
  80. // return next();
  81. // },
  82. // function build_and_execSync_machine_with_crazy_numbers_of_inputs_and_exits_and_is_cacheable(next){
  83. // var m = Machine.build(DO_SOMETHING_INSANE_BUT_CACHEABLE_WITH_MANY_BASIC_EXEMPLARS);
  84. // m(SAMPLE_MANY_BASIC_ARGINS).execSync();
  85. // return next();
  86. // },
  87. // function build_and_execSync_machine_with_crazy_numbers_of_inputs_and_exits_with_huge_exemplars(next){
  88. // var m = Machine.build(DO_SOMETHING_INSANE_WITH_MANY_COMPLEX_EXEMPLARS);
  89. // m(SAMPLE_MANY_COMPLEX_ARGINS).execSync();
  90. // return next();
  91. // },
  92. // function build_and_execSync_machine_with_crazy_numbers_of_inputs_and_exits_with_ref_exemplars(next){
  93. // var m = Machine.build(DO_SOMETHING_INSANE_WITH_MANY_REF_EXEMPLARS);
  94. // m(SAMPLE_MANY_COMPLEX_ARGINS).execSync();
  95. // return next();
  96. // },
  97. // ], done);
  98. // });//</should be performant enough>
  99. // });