Absence of Compile warning in Mathematica 4
- To: mathgroup at smc.vnet.net
- Subject: [mg18430] Absence of Compile warning in Mathematica 4
- From: "William B. Marks" <bmarks at helix.nih.gov>
- Date: Wed, 7 Jul 1999 00:11:19 -0400
- Sender: owner-wri-mathgroup at wolfram.com
When I run the program rCMP = Compile[{x}, Module[{as = {0., 0.}, a1=0., a2=0.}, {a1, a2} = {x, x+1.}; as = {x, x+1.}; (* {a1, a2} = as; *) ]]; with and without the commented line, the times on a PPC for rCMP /@ Range[5000.];//Timing in Mathematica 3 and Mathematica 4 are Mathematica 3 without: .08; Mathematica 3 with: 0.1 Mathematica 4 without: .15; Mathematica 4 with:1.9 Mathematica 4 is a little slower than Mathematica 3 for this. But mainly, there is a factor of about 13 slowdown in Mathematica 4 when we unpack a list. This is probably a reversion to uncompiled form without warning, specific to Mathematica 4. As a workaround I use as[[1]], as[[2]],... instead of a1, a2,... . Is this error published, perhaps along with others I should know about?