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

Comparing UUIDs is unnecessarily slow #32

Open
rauhs opened this issue Jun 30, 2017 · 0 comments
Open

Comparing UUIDs is unnecessarily slow #32

rauhs opened this issue Jun 30, 2017 · 0 comments

Comments

@rauhs
Copy link

rauhs commented Jun 30, 2017

With the current implementation:

(extend-protocol IComparable
  UUID
  (-compare [this other]
    (if (or (instance? UUID other)
            (instance? ty/UUID other))
      (compare (.toString this) (.toString other))
      (throw (js/Error. (str "Cannot compare " this " to " other)))))

The compare call will again check the strings for IComparable and even call (slow) native-satisfies this is very undesirable since I'm relying on fast comparisons in datascript datoms.

It'd be better if a call to garray/defaultCompare were made (as is done in cljs.core).

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