Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10674

Re: Replace, ReplaceAll and If time performace comparition

From awnl <awnl@gmx-topmail.de>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Replace, ReplaceAll and If time performace comparition
Date 2012-06-28 08:00 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jsh2uq$sah$1@smc.vnet.net> (permalink)
References <201206240826.EAA08423@smc.vnet.net> <201206250801.EAA15438@smc.vnet.net> <jseetb$i34$1@smc.vnet.net>

Show all headers | View raw


Hi,

> As you can see Clip can still be topped by a factor 1.45 by using
> procedural and compiled code
> (for me the most interesting enhancements in Mathematica 8).

that seems to be somewhat dependent on your setup (hardware, OS, 
compiler ...). For me the compiled versions are slightly slower than 
Clip (with MS compiler on Windows 7 64bit). As the code is so simple I 
wouldn't expect that a compiler would have much chance to do good or bad 
optimizing it, but still, probably your compiler is doing a better job 
than mine :-).

> What I found surprising is that cf2 ("Speed") is slower than cf1
> ("Quality") and cf0. I also
> did not increase the performance when parallelizing (use
> Parallelization->True).

that is strange indeed, I see the same thing. I have seen large 
differences in other cases, but probably that's because most of those 
options are irrelevant for the code that's run (no danger of 
underflow/overflow etc.). For the parallelization: I think this will 
only have an effect if you make your compiled function Listable and the 
function "threads over list arguments". Rewriting your function that way 
(avoiding the Do-loop) turns out to be a performance disaster, though :-)

> By the way,
> the ranking between cf1, cf0 is just an incidence . They are of the same
> performance (on my PC).
>
> Can anyone top the result?

not me, I won't even try. And I won't buy a better compiler to proof a 
point :-)

albert

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Replace, ReplaceAll and If time performace comparition Christoph Lhotka <christoph.lhotka@fundp.ac.be> - 2012-06-27 08:06 +0000
  Re: Replace, ReplaceAll and If time performace comparition awnl <awnl@gmx-topmail.de> - 2012-06-28 08:04 +0000
  Re: Replace, ReplaceAll and If time performace comparition awnl <awnl@gmx-topmail.de> - 2012-06-28 08:00 +0000
  Re: Replace, ReplaceAll and If time performace comparition Christoph Lhotka <christoph.lhotka@fundp.ac.be> - 2012-06-29 08:48 +0000
    Re: Replace, ReplaceAll and If time performace comparition awnl <awnl@gmx-topmail.de> - 2012-06-30 09:16 +0000

csiph-web