We can collect all symbol/keyword literals during analysis - we can emit a static symbol/keyword table at the top and replace with direct identifiers when we compile. We can change the symbols/keyword fn to create symbol/keyword instances and intern them in a runtime table (the static table will be obfuscated away).
That's the basic sketch I have in mind. David On Mon, Nov 26, 2012 at 4:45 PM, Herwig Hochleitner <[email protected]>wrote: > 2012/11/26 David Nolen <[email protected]> > >> keywords & symbols as proper types is probably not far off and optimizing >> them doesn't need to wait for a general whole program optimization strategy. >> >> > Certainly, gclosure can't generally eliminate the check in: var mykw > = kw_table[kw_str] || (kw_table[kw_str] = new Keyword(kw_str)); > Are you thinking about hoisting Keyword initialization to the top level? > > Thinking about it, in the current impl, (:kw m) compiles to (new > Keyword("kw")).call(null, m), so the alternative above might even compare > favorably. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
