Re: Type annonations in clojure.instant/print-date result in speedup of 3

2013-10-10 Thread Alexander Kiel
Thanks Andy. I added a comment to 
http://dev.clojure.org/jira/browse/CLJ-1277

Am Donnerstag, 10. Oktober 2013 07:12:47 UTC+2 schrieb Andy Fingerhut:

 Thanks for checking, Alexander.  I have created ticket CLJ-1277 with a 
 patch that improves the performance of the case you found, as well as for 
 java.sql.Timestamp printing that also had reflection in it nearly identical 
 to what you found.

 http://dev.clojure.org/jira/browse/CLJ-1277

 Feel free to create an account on JIRA and vote for it, if you want to 
 help draw attention to it:

 http://dev.clojure.org/jira/secure/Signup!default.jspa

 You can also click the Watch link (after logging in) if you want to be 
 emailed of updates to the ticket's status.  I can make no promises on when 
 or if that might happen.

 Andy


 On Wed, Oct 9, 2013 at 10:47 AM, Alexander Kiel 
 alexan...@gmx.netjavascript:
  wrote:

 Hi Andy,

 http://dev.clojure.org/jira/browse/CLJ-1080 has not the same type hints 
 as I propose. You can see my patch here:

 https://github.com/alexanderkiel/clojure/compare/instant-type-hints

 I have an additional type hint at thread-local-utc-date-format and I use 
 java.text.DateFormat instead of java.text.SimpleDateFormat at utc-format.

 Alex

 Am Mittwoch, 9. Oktober 2013 18:49:32 UTC+2 schrieb Andy Fingerhut:

 Could you take a look at the patch on ticket CLJ-1080 and see if it 
 contains all of the improvements you mention?  Let me know if it doesn't, 
 and we can look at combining your improvements into that patch.

 
 http://dev.clojure.org/jira/**browse/CLJ-1080http://dev.clojure.org/jira/browse/CLJ-1080

 Andy


 On Wed, Oct 9, 2013 at 8:57 AM, Alexander Kiel alexan...@gmx.netwrote:

 Hi,

 I have a web service returning edn representations containing many 
 java.util.Date values. Using a profiler, one Hot Spot is inside the 
 clojure.instant/print-date function. The relevant reflections warnings are:

 Reflection warning, 
 instant.cljhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj:172:20
  
 - reference to field get can't be resolved.
 Reflection warning, instant.clj:174:15 - call to format can't be 
 resolved.
 Reflection warning, instant.clj:174:5 - call to write can't be 
 resolved.

 Adding a ^ThreadLocal annotation to thread-local-utc-date-**format and 
 a ^java.text.DateFormat to utc-format resolves all reflection warnings.

 I tested the speedup with 

 (time (let [d (java.util.Date.)] (doseq [_ (range 10)] (pr-str 
 d

 which takes about 1500 ms without the type annotations and about 500 ms 
 with type annotations.

 A single web service access is speeded up from about 350 ms to 250 ms. 
 The response contains about 3000 java.util.Date values.

 I could create a pull request if that would help. But I like to discuss 
 the change first. I have no CA so I use Clojure instead of Clojure Dev.

 Alex

 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com

 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google 
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to clojure+u...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 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 unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop 

Type annonations in clojure.instant/print-date result in speedup of 3

2013-10-09 Thread Alexander Kiel
Hi,

I have a web service returning edn representations containing many 
java.util.Date values. Using a profiler, one Hot Spot is inside the 
clojure.instant/print-date function. The relevant reflections warnings are:

Reflection warning, 
instant.cljhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj:172:20
 
- reference to field get can't be resolved.
Reflection warning, instant.clj:174:15 - call to format can't be 
resolved.
Reflection warning, instant.clj:174:5 - call to write can't be resolved.

Adding a ^ThreadLocal annotation to thread-local-utc-date-format and 
a ^java.text.DateFormat to utc-format resolves all reflection warnings.

I tested the speedup with 

(time (let [d (java.util.Date.)] (doseq [_ (range 10)] (pr-str d

which takes about 1500 ms without the type annotations and about 500 ms 
with type annotations.

A single web service access is speeded up from about 350 ms to 250 ms. The 
response contains about 3000 java.util.Date values.

I could create a pull request if that would help. But I like to discuss the 
change first. I have no CA so I use Clojure instead of Clojure Dev.

Alex

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Type annonations in clojure.instant/print-date result in speedup of 3

2013-10-09 Thread Andy Fingerhut
Could you take a look at the patch on ticket CLJ-1080 and see if it
contains all of the improvements you mention?  Let me know if it doesn't,
and we can look at combining your improvements into that patch.

http://dev.clojure.org/jira/browse/CLJ-1080

Andy


On Wed, Oct 9, 2013 at 8:57 AM, Alexander Kiel alexanderk...@gmx.netwrote:

 Hi,

 I have a web service returning edn representations containing many
 java.util.Date values. Using a profiler, one Hot Spot is inside the
 clojure.instant/print-date function. The relevant reflections warnings are:

 Reflection warning, 
 instant.cljhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj:172:20
 - reference to field get can't be resolved.
 Reflection warning, instant.clj:174:15 - call to format can't be
 resolved.
 Reflection warning, instant.clj:174:5 - call to write can't be
 resolved.

 Adding a ^ThreadLocal annotation to thread-local-utc-date-format and
 a ^java.text.DateFormat to utc-format resolves all reflection warnings.

 I tested the speedup with

 (time (let [d (java.util.Date.)] (doseq [_ (range 10)] (pr-str
 d

 which takes about 1500 ms without the type annotations and about 500 ms
 with type annotations.

 A single web service access is speeded up from about 350 ms to 250 ms. The
 response contains about 3000 java.util.Date values.

 I could create a pull request if that would help. But I like to discuss
 the change first. I have no CA so I use Clojure instead of Clojure Dev.

 Alex

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Type annonations in clojure.instant/print-date result in speedup of 3

2013-10-09 Thread Alexander Kiel
Hi Andy,

http://dev.clojure.org/jira/browse/CLJ-1080 has not the same type hints as 
I propose. You can see my patch here:

https://github.com/alexanderkiel/clojure/compare/instant-type-hints

I have an additional type hint at thread-local-utc-date-format and I use 
java.text.DateFormat instead of java.text.SimpleDateFormat at utc-format.

Alex

Am Mittwoch, 9. Oktober 2013 18:49:32 UTC+2 schrieb Andy Fingerhut:

 Could you take a look at the patch on ticket CLJ-1080 and see if it 
 contains all of the improvements you mention?  Let me know if it doesn't, 
 and we can look at combining your improvements into that patch.

 http://dev.clojure.org/jira/browse/CLJ-1080

 Andy


 On Wed, Oct 9, 2013 at 8:57 AM, Alexander Kiel alexan...@gmx.netjavascript:
  wrote:

 Hi,

 I have a web service returning edn representations containing many 
 java.util.Date values. Using a profiler, one Hot Spot is inside the 
 clojure.instant/print-date function. The relevant reflections warnings are:

 Reflection warning, 
 instant.cljhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj:172:20
  
 - reference to field get can't be resolved.
 Reflection warning, instant.clj:174:15 - call to format can't be 
 resolved.
 Reflection warning, instant.clj:174:5 - call to write can't be 
 resolved.

 Adding a ^ThreadLocal annotation to thread-local-utc-date-format and 
 a ^java.text.DateFormat to utc-format resolves all reflection warnings.

 I tested the speedup with 

 (time (let [d (java.util.Date.)] (doseq [_ (range 10)] (pr-str 
 d

 which takes about 1500 ms without the type annotations and about 500 ms 
 with type annotations.

 A single web service access is speeded up from about 350 ms to 250 ms. 
 The response contains about 3000 java.util.Date values.

 I could create a pull request if that would help. But I like to discuss 
 the change first. I have no CA so I use Clojure instead of Clojure Dev.

 Alex

 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 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 unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Type annonations in clojure.instant/print-date result in speedup of 3

2013-10-09 Thread Andy Fingerhut
Thanks for checking, Alexander.  I have created ticket CLJ-1277 with a
patch that improves the performance of the case you found, as well as for
java.sql.Timestamp printing that also had reflection in it nearly identical
to what you found.

http://dev.clojure.org/jira/browse/CLJ-1277

Feel free to create an account on JIRA and vote for it, if you want to help
draw attention to it:

http://dev.clojure.org/jira/secure/Signup!default.jspa

You can also click the Watch link (after logging in) if you want to be
emailed of updates to the ticket's status.  I can make no promises on when
or if that might happen.

Andy


On Wed, Oct 9, 2013 at 10:47 AM, Alexander Kiel alexanderk...@gmx.netwrote:

 Hi Andy,

 http://dev.clojure.org/jira/browse/CLJ-1080 has not the same type hints
 as I propose. You can see my patch here:

 https://github.com/alexanderkiel/clojure/compare/instant-type-hints

 I have an additional type hint at thread-local-utc-date-format and I use
 java.text.DateFormat instead of java.text.SimpleDateFormat at utc-format.

 Alex

 Am Mittwoch, 9. Oktober 2013 18:49:32 UTC+2 schrieb Andy Fingerhut:

 Could you take a look at the patch on ticket CLJ-1080 and see if it
 contains all of the improvements you mention?  Let me know if it doesn't,
 and we can look at combining your improvements into that patch.

 
 http://dev.clojure.org/jira/**browse/CLJ-1080http://dev.clojure.org/jira/browse/CLJ-1080

 Andy


 On Wed, Oct 9, 2013 at 8:57 AM, Alexander Kiel alexan...@gmx.net wrote:

 Hi,

 I have a web service returning edn representations containing many
 java.util.Date values. Using a profiler, one Hot Spot is inside the
 clojure.instant/print-date function. The relevant reflections warnings are:

 Reflection warning, 
 instant.cljhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj:172:20
 - reference to field get can't be resolved.
 Reflection warning, instant.clj:174:15 - call to format can't be
 resolved.
 Reflection warning, instant.clj:174:5 - call to write can't be
 resolved.

 Adding a ^ThreadLocal annotation to thread-local-utc-date-**format and
 a ^java.text.DateFormat to utc-format resolves all reflection warnings.

 I tested the speedup with

 (time (let [d (java.util.Date.)] (doseq [_ (range 10)] (pr-str
 d

 which takes about 1500 ms without the type annotations and about 500 ms
 with type annotations.

 A single web service access is speeded up from about 350 ms to 250 ms.
 The response contains about 3000 java.util.Date values.

 I could create a pull request if that would help. But I like to discuss
 the change first. I have no CA so I use Clojure instead of Clojure Dev.

 Alex

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com

 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to clojure+u...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.