Hello,
When I read the source code keyword, say, Keyword.java (V1.3), I found that
when we intern a keyword, (if I understand it correctly) it uses a
cache for keywords:
=
public static Keyword intern(Symbol sym) {
if (sym.meta() != null)
sym =
Compare keywords can be very fast.
在 2012-7-18 PM4:51,jaime xiejianm...@gmail.com写道:
Hello,
When I read the source code keyword, say, Keyword.java (V1.3), I found
that when we intern a keyword, (if I understand it correctly) it uses
a cache for keywords:
I doubt because keyword will use its internal Symbol object to compare with
each other (or other objects), it means it's Symbol's interned strings(ns
name) make the comparison fast but not this caching stuff. I found a
find() method in source code but not sure if the cache is relevant to
this
I think this cache is just the same with String.intern method in java,it
just want to reduce the cost (memory cpu) of producing keywords
frequently especial when using them with map structure.
2012/7/18 jaime xiejianm...@gmail.com
I doubt because keyword will use its internal Symbol object to
make senseI just came up with this similar answer on my way
home...Thanks.
在 2012年7月18日星期三UTC+8下午6时56分42秒,dennis写道:
I think this cache is just the same with String.intern method in java,it
just want to reduce the cost (memory cpu) of producing keywords
frequently especial when using