Re: Release date for 1.9

2017-03-06 Thread Alexander Kiel
We also run Clojure 1.9-alpha with great success in production. Being alpha 
doesn't mean that it's buggy. It just means that the new stuff can still 
change.

Am Dienstag, 28. Februar 2017 21:10:59 UTC+1 schrieb Dan Burton:
>
> Obligatory: "our team uses clojure-future-spec with clojure-1.8" -- no 
> problems so far.
>
> -- Dan Burton
>
> On Tue, Feb 28, 2017 at 11:59 AM, Sean Corfield  > wrote:
>
>> On 2/28/17, 10:26 AM, "Erik Assum" > on behalf of er...@assum.net > wrote:
>> > And, yes, I'm aware of the fact that the 1.9-alphas are very stable wrt 
>> putting it in production.
>>
>> Obligatory: “we’ve been running the 1.9 Alphas in production for months 
>> so that we can leverage clojure.spec” – no problems so far.
>>
>> Sean Corfield -- (904) 302-SEAN -- (970) FOR-SEAN
>> World Singles -- http://worldsingles.com/
>>
>>
>>
>>
>>
>> --
>> 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=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/d/optout.
>>
>
>

-- 
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/d/optout.


Idiomatic way to return a single value from an async function

2014-11-10 Thread Alexander Kiel
Hi,

what is the most idiomatic way to return a single value from an async 
function in Clojure?

A: return a channel which conveys the result later; also closes the channel

(defn f [x]
  (let [c (chan)]
; put result onto c and close c later
c))

B: take a channel onto which the result is put later; do not close that 
channel; return nil immediately

(defn f [x c]
  ; put result onto and close c later
  nil)

Variant A has the advantage that it needs one function argument less than 
variant B. It's also better usable in higher order functions like map. 
Variant A is also more easy to use if you need to create a channel anyway.

Variant A has the disadvantage of creating a new channel each time the 
async function is called. According my measurements using criterium 0.4.3, 
clojure 
1.6.0 and core.async 0.1.346.0-17112a-alpha, the runtime cost of creating a 
channel is about 8 times more expensive as creating a single object.

Variant B has the advantage to not create a channel on every call. You can 
supply the same channel many times to the function. On the other hand, the 
results of multiple calls to f are not likely to arrive on that single 
channel in call order. If you have such an ordering requirement, you have 
to create a single channel for each function call anyway.

Variant B has the disadvantage that it requires one function argument more 
than variant A. As a consequence, you can't simply map such a function over 
a list of inputs.

Variant A seems to be the winner. But I ask specially because pipeline-async 
https://clojure.github.io/core.async/#clojure.core.async/pipeline-async uses 
variant B.

What do you think?

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/d/optout.


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 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.