That was fixed in a patch that added special cases to partial when used
with smaller numbers of arguments. It was never much slower, but it should
be just as fast as hand made functions now.

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

On Fri, Oct 28, 2016 at 5:35 AM, Bobby Eickhoff <beickh...@gmail.com> wrote:

> I agree that forms like (partial > 3) are clearer than #() forms.
> However, I've been avoiding partial in code bases for a while -- it was
> measurably slower than the alternative.  Is that still the case?  Has
> anyone else observed slowness with partial?
>
> On Thursday, October 27, 2016 at 8:44:14 PM UTC-4, tbc++ wrote:
>>
>> I use comp all the time, not only for transducers, but also for digging
>> into maps:
>>
>>
>> (map (comp first :pets)
>>    [{:pets [:fluffy]}
>>     {:pets [:spot]}])
>>
>> => (:fluffy, :spot)
>>
>> Partial is also handy when used with a lot of sequence functions
>>
>> (->> [1 2 3 4 5]
>>        (filter (partial > 3)))
>>
>> Sure I could write that function as #(< 3 %), but I find that syntax
>> harder to mentally parse as I have to remember that the body of the #() is
>> a function context and then I have to look up where the % symbol is.
>> (partial > 3) is just easier to understand.
>>
>> Timothy
>>
>>
>>
>> On Thu, Oct 27, 2016 at 6:12 PM, Mark Engelberg <mark.en...@gmail.com>
>> wrote:
>>
>>> On Thu, Oct 27, 2016 at 9:39 AM, Alan Thompson <cloo...@gmail.com>
>>> wrote:
>>>
>>>> I almost never use either the `comp` or the `partial` functions.  I
>>>> think it is clearer to either compose the functions like Gary showed, or to
>>>> use a threading macro (my favorite is the `it->` macro from the Tupelo
>>>> library <https://github.com/cloojure/tupelo#literate-threading-macro>).
>>>> Alan
>>>>
>>>>
>>> You need to use comp if you're building a transducer.
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> “One of the main causes of the fall of the Roman Empire was that–lacking
>> zero–they had no way to indicate successful termination of their C
>> programs.”
>> (Robert Firth)
>>
> --
> 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.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

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

Reply via email to