Closed vvvvalvalval closed 9 years ago
Are you talking about clojurescript keywords? They are just wrappers around strings, so don’t expect perf boost there
Yes I am.
This thread led me to think keywords would be faster to check for equality - but I believe you, you've probably been further down this road than me.
Right. CLJS identical check for keywords is reference comparison, whether for JS strings it is not. On the other hand, DS relies on compare
, not on equality/identity check. Compare for keywords is slightly more complicated than compare on strings. Overall, you should not lose anything using strings
I'm using Datascript from Javascript in the browser, and I have not found any way to use keywords for attribute values; I believe it could be valuable for performance reasons.
Is this a design choice? If not, maybe just exposing a
keyword
function could do the trick.