Slows specs can be a real burden when doing dev, because the slowdown can be significant.
ideas for speed up:
Tight loops: rapid repeated calls to check specs should stop checking after a small number, or should do random sampling. Another option would be to use a dropping async buffer and just shove lambdas to do the check/report into the queue, allowing production speeds with the chance that some checks won't run. A configurable queue would make this good enough in many many cases, and would allow the checks to use an alt thread.
Slow specs: Measure how long a particular function takes to check. If it is slow, check a smaller percentage of calls to it, perhaps always checking the 1st (since there may only be one) when there has been a reasonable time since it was last checked.
Devs usually do things in spurts, so the first soln might actually work quite well. A deep enough queue will check 100% of the things, but on whatever delay is required. An overall check "timeout" could be configured to cause it to stop discard the queue, and warn that the queue was too busy.
Slows specs can be a real burden when doing dev, because the slowdown can be significant.
ideas for speed up:
Tight loops: rapid repeated calls to check specs should stop checking after a small number, or should do random sampling. Another option would be to use a dropping async buffer and just shove lambdas to do the check/report into the queue, allowing production speeds with the chance that some checks won't run. A configurable queue would make this good enough in many many cases, and would allow the checks to use an alt thread.
Slow specs: Measure how long a particular function takes to check. If it is slow, check a smaller percentage of calls to it, perhaps always checking the 1st (since there may only be one) when there has been a reasonable time since it was last checked.
Devs usually do things in spurts, so the first soln might actually work quite well. A deep enough queue will check 100% of the things, but on whatever delay is required. An overall check "timeout" could be configured to cause it to stop discard the queue, and warn that the queue was too busy.