Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Replace, ReplaceAll and If time performace comparition

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127071] Re: Replace, ReplaceAll and If time performace comparition
  • From: awnl <awnl at gmx-topmail.de>
  • Date: Thu, 28 Jun 2012 04:02:22 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201206240826.EAA08423@smc.vnet.net> <201206250801.EAA15438@smc.vnet.net> <jseetb$i34$1@smc.vnet.net>

Hi,

> Can anyone top the result?

contradicting to my announcement, I tried anyway and found this to be 
considerably faster on my machine:

cf3 = Compile[{{list, _Integer, 1}},
  Map[If[# > 0, #, 0] &, list],
  CompilationTarget -> "C"
]

hth,

albert



  • Prev by Date: Re: needed.
  • Next by Date: Re: LibraryLink & MinGW
  • Previous by thread: Re: Replace, ReplaceAll and If time performace comparition
  • Next by thread: Re: Replace, ReplaceAll and If time performace comparition