[TRDR-6] Some uses of reflection in tools.reader code slow it down unnecessarily Created: 13/Apr/13 Updated: 13/Apr/13 Resolved: 13/Apr/13
|Reporter:||Andy Fingerhut||Assignee:||Nicola Mometto|
Attached patch uses type hints to eliminate several instances of reflection in the tools.reader code.
FYI, you can run 'lein check' to cause Leiningen to compile the code with warn-on-reflection true, I believe for every source file (not sure about the tests, but reflection isn't such a big deal in them anyway).
|Comment by Nicola Mometto [ 13/Apr/13 12:13 PM ]|
Andy, I don't see any patch attached to this ticket, I think you forgot to attach it.
(P.S. thanks, I didn't know about 'lein check')
|Comment by Andy Fingerhut [ 13/Apr/13 12:19 PM ]|
Patch trdr-6-eliminate-reflection-with-type-hints-patch-v1.txt dated Apr 13 2013 eliminates all occurrences of reflection found in latest version of tools.reader. Please check them carefully before committing them, especially the ones in default_data_readers.clj.
And I know the reflection warnings in default_data_readers.clj exist in Clojure's code, too, where you copied those from. CLJ-1080 has a patch addressing those and many other reflections within Clojure's code.
|Comment by Nicola Mometto [ 13/Apr/13 12:59 PM ]|
Andy, casting to char makes tools.reader crash under clojure-1.3, apparently casting to char is possible only from clojure 1.4.
Could you please submit a patch removing reflection in default_data_readers.clj and the docstring fixes only while I try to figure out a way to maintain clojure 1.3 compatibility and remove the reflection? (or if you have an idea on how to do it, you're more than welcome )
|Comment by Andy Fingerhut [ 13/Apr/13 2:43 PM ]|
Great. I was off-line there for a while, but glad you noticed the 1.3 compatibility issue where I didn't, and glad you found a different way to eliminate reflection with 1.4 and later.