Maybe this is just obvious, but it's not making much sense to me.
If I have a reference to a function (pardon if that's not the correct
Julia-ish terminology - basically just a variable that holds a Function
type) and call it, it runs much more slowly (persumably because it's
allocating a lot
This is a known limitation of Julia. The trouble is that Julia cannot
do its type interference with the passed in function. I don't have time
to search for the relevant issues but you should be able to find them.
Similarly, lambdas also suffer from this. Hopefully this will be
resolved soon!
On
There have been many prior posts about this topic. Maybe we should add a FAQ
page we can direct people to. In the mean time, your best bet is to search (or
use FastAnonymous or NumericFuns).
--Tim
On Wednesday, March 25, 2015 11:41:10 AM Phil Tomson wrote:
> Maybe this is just obvious, but it'
I have a couple of instances where a function is determined by some
parameters (in a JSON file in this case) and I have to call it in this
manner. I'm thinking it should be possible to speed these up via a macro,
but I'm a macro newbie. I'll probably post a different question related to
that,
Don't use a macro, just use the @anon macro to create an object that will be
fast to use as a "function."
--Tim
On Wednesday, March 25, 2015 01:00:27 PM Phil Tomson wrote:
> I have a couple of instances where a function is determined by some
> parameters (in a JSON file in this case) and I have
On Wednesday, March 25, 2015 at 1:08:24 PM UTC-7, Tim Holy wrote:
>
> Don't use a macro, just use the @anon macro to create an object that will
> be
> fast to use as a "function."
>
I guess I'm not understanding how this is used, I would have thought I'd
need to do something like:
julia>
f
No, it's
f = @anon x->abs(x)
and then pass f to test_time. Declare the function like this:
function test_time{F}(func::F)
end
--Tim
On Wednesday, March 25, 2015 01:30:28 PM Phil Tomson wrote:
> On Wednesday, March 25, 2015 at 1:08:24 PM UTC-7, Tim Holy wrote:
> > Don't use a macro,
On Wednesday, March 25, 2015 at 1:52:04 PM UTC-7, Tim Holy wrote:
>
> No, it's
>
>f = @anon x->abs(x)
>
> and then pass f to test_time. Declare the function like this:
>
> function test_time{F}(func::F)
>
> end
>
Ok, got that working, but when I try using it inside the functio
On Thursday, March 26, 2015 at 8:06:41 AM UTC+11, Phil Tomson wrote:
>
>
>
> On Wednesday, March 25, 2015 at 1:52:04 PM UTC-7, Tim Holy wrote:
>>
>> No, it's
>>
>>f = @anon x->abs(x)
>>
>> and then pass f to test_time. Declare the function like this:
>>
>> function test_time{F}(func::F)
>
The function-to-be-called is not known at compile time in Phil's
application, apparently.
Question for Phil: are there a limited set of functions that you know
you'll be calling here? I was doing something similar recently, where it
actually made the most sense to create a fixed Dict{Symbol, UI
On Wednesday, March 25, 2015 at 5:07:27 PM UTC-7, Tony Kelman wrote:
>
> The function-to-be-called is not known at compile time in Phil's
> application, apparently.
>
Right, they come out of a JSON file. I parse the JSON and construct a list
of processing nodes from it and those could have 1 o
Here's the code I was referring to
- https://github.com/tkelman/BLOM.jl/blob/master/src/functioncodes.jl
In my case I'm using Float64 function codes for other reasons, created by
reinterpreting a UInt64 with a few bits flipped. Using UInts directly,
probably from the object_id of the symbol, wo
On Wednesday, March 25, 2015 at 12:34:47 PM UTC-7, Mauro wrote:
>
> This is a known limitation of Julia. The trouble is that Julia cannot
> do its type interference with the passed in function. I don't have time
> to search for the relevant issues but you should be able to find them.
> Simil
>> This is a known limitation of Julia. The trouble is that Julia cannot
>> do its type interference with the passed in function. I don't have time
>> to search for the relevant issues but you should be able to find them.
>> Similarly, lambdas also suffer from this. Hopefully this will be
>>
14 matches
Mail list logo