Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

See this example, a function has Listable attributes often more efficient than Map,but why is this one is an exception?

With[{n = 6},
   IntegerDigits[Range[10^(n - 1), 10^n - 1]]
   ] // Hash // AbsoluteTiming
(*{1.573090, 756716557}*)

With[{n = 6},
   IntegerDigits /@ Range[10^(n - 1), 10^n - 1]
   ] // Hash // AbsoluteTiming
(*{0.202012, 756716557}*)
share|improve this question
up vote 9 down vote accepted

Map is autocompiling. If you turn autocompilation off, i.e., if you set

  "CompileOptions" -> "MapCompileLength" -> Infinity];

then the timings are the same.

Mathematica graphics

share|improve this answer
But you artificially made Map slower. – Sasha Aug 19 '13 at 11:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.