Advantages of testComplexity
over GuessCompx
:
-
The memory complexity classifying method in GuessCompx uses calls to
memory.size()
, a function only available in Windows (discussed on their paper and mentioned as a limitation) and hence this functionality is not cross-platform and only available to Windows users. In other words, it is completely inaccessible to users of other OS-variants such as Linux and MacOS. For testComplexity, I used the the functionbench::bench_memory()
from the bench package to compute the memory allocations, which uses APIs for all the operating systems (including Linux & MacOS that GuessCompx couldn’t cover), making the memory complexity testing functionality (and everything else) cross-platform. -
Everything (sampling and complexity testing for time/memory cases + even plotting) is incorporated into the
GuessCompx::CompEst()
function, which means there is high coupling, which is generally a bad software development practice. For instance, if one of the functions being called intoCompEst()
throws an error, the entire function would break. In contrast, all the functions of testComplexity can be used seperately and the coupling is very low (as ideal for software), with modules for each task (time/memory cases for quantification, complexity classification, plotting etc.) being kept seperate. -
Both the quantifiers (functions which include the benchmark computation) in my package have only three parameters (as opposed to the ten in
GuessCompx::CompEst()
), with all of them being simple to use and adjusted as per user-convenience. (changes were made to the time quantifier to make it user-friendly) -
There is no use of an extra variable for the log-linear complexity class (that GuessCompx had as instances of
NlogN
), with the complexity classification scope correctly taking into account the double use of the input size (N
) in the generalized linear model (glm) formula. -
Benchmarking/Profiling is used as the method to compute the data to be used in the complexity classification glms, (instead of the sampling procedure used in GuessCompx, which is more random) producing more precise results. (especially for time complexity classification)
-
In addition to that, all software development best practices were followed, including continuous integration & checking of builds at each step (cross-platform deployment), unit-testing of functions and code coverage. (testComplexity has 100% code coverage as well)