tstl icon indicating copy to clipboard operation
tstl copied to clipboard

Test automation program spends too much time

Open samchon opened this issue 5 years ago • 2 comments

The test automation program executed by npm run test, it spends too much time (over 20 seconds). To reduce the elapsed time, the first mission is to measuring elapsed time of each feature. After the measurement, I'll optimize long-time consuming features.

samchon avatar Dec 11 '19 06:12 samchon

Elapsed times

Looking at the below result and traveling the long-timed elapsed features, I could find two common things. To resolve that, I should re-design such long-time spending test features.

  • Test with random generator and supplement the uncertainty with numerous repeating
  • Sleep too much time for testing critical section
> [email protected] test /Users/samchon/Documents/samchon/tstl
> node test

==========================================================
 TSTL Test Automation Program
==========================================================
  - test_binary_searches: 94 ms
  - test_heaps: 20 ms
  - test_iterations: 4 ms
  - test_mathmatics: 3 ms
  - test_modifiers: 15 ms
  - test_partitions: 1 ms
  - test_randoms: 228 ms
  - test_sortings: 30 ms
  - test_union_sets: 0 ms
  - test_priority_queue: 11 ms
  - test_adaptors: 1 ms
  - test_associatives: 21 ms
  - test_for_of_iterations: 2 ms
  - test_linear_containers: 1 ms
  - test_lists: 2 ms
  - test_swaps: 13 ms
  - test_trees: 8,901 ms
  - test_vector_bools: 418 ms
  - test_exception_names: 0 ms
  - test_terminate: 1 ms
  - test_comparisons: 5 ms
  - test_inserters: 0 ms
  - test_numeric_algorithms: 1 ms
  - test_special_maths: 2,028 ms
  - test_iterations: 0 ms
  - test_condition_variables: 821 ms
  - test_mutexes: 1,309 ms
  - test_unique_locks: 3 ms
  - test_shared_locks: 1 ms
  - test_semaphores: 331 ms
  - test_shared_mutexes: 5,331 ms
  - test_sleeps: 1,007 ms
  - test_utilities: 0 ms
----------------------------------------------------------
Success
  - elapsed time: 20,713 ms
  - rss: 72.29 MB
  - heapTotal: 41.81 MB
  - heapUsed: 16.65 MB
  - external: 0.79 MB
----------------------------------------------------------

samchon avatar Dec 12 '19 08:12 samchon

Any interests to introduce test frameworks, like jest or ava?

chinesedfan avatar Sep 13 '21 01:09 chinesedfan