Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only conditionally enable "less useful" specs #105

Closed
borkdude opened this issue Nov 12, 2018 · 1 comment
Closed

Only conditionally enable "less useful" specs #105

borkdude opened this issue Nov 12, 2018 · 1 comment

Comments

@borkdude
Copy link
Owner

borkdude commented Nov 12, 2018

Related to #44

The following spec aren't really helping when instrumenting, but they do require extra CPU (see https://gist.github.com/borkdude/8a977fa453c6ee26fefcecb4c88fe1f2).

= ;; no way to pass wrong args (except arity)
/ ;; inlined
get ;; no way to pass wrong args (except arity)
some? ;; no way to pass wrong args (except arity)
str ;; no way to pass wrong args

There should be a way have them turned off by default, but to conditionally enable them.

Unstrumenting after the fact would be an option, but I think this should be as smooth as possible for the user of this library, so not loading the fdefs in the first place has my preference.

Moving them to a different namespace would be the easiest option for all environments.

borkdude added a commit that referenced this issue Nov 12, 2018
@borkdude
Copy link
Owner Author

borkdude commented Nov 12, 2018

Fixed in #106.

Running the first 20 coal-mine tests in cljs+node without instrumenting the optional less useful specs, compare

"Elapsed time: 3198.731217 msecs"

to

"Elapsed time: 21343.952922 msecs"

Also note that the tests do not even pass when having the optional specs instrumented due to several "maximum call stack exceeded" errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant