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

validate slow when there's an error #352

Closed
sonwh98 opened this issue Apr 13, 2016 · 2 comments
Closed

validate slow when there's an error #352

sonwh98 opened this issue Apr 13, 2016 · 2 comments

Comments

@sonwh98
Copy link

sonwh98 commented Apr 13, 2016

(def KoalaState {:company-name s/Str
                           :logged-in s/Bool})

(s/validate KoalaState {:company-name "koala" :logged-in "false"})

validate returns immediately when the type matches. However, if it doesn't match like the above, it takes a 20 seconds to return the error message. Is this normal?

validate returns quickly when there's an error in Clojure. The slowness is only in ClojureScript

@w01fe
Copy link
Member

w01fe commented Apr 13, 2016

First I've heard about this. My guess is it's something to do with your environment and how it handles errors, rather than anything to do with schema. What happens if you just throw an exception rather than calling s/validate?

@sonwh98
Copy link
Author

sonwh98 commented Apr 13, 2016

oh you're right. I was testing it in the boot.cljs clojurescript repl. (js/throw "foo") also takes a long time

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

2 participants