# Dractic slowdown in the performance of Table

**URL:** <https://community.wolfram.com/t/dractic-slowdown-in-the-performance-of-table/25440>\
**Category:** Questions\
**Tags:** tuning-and-debugging\
**Created:** [May 5, 2025, 9:52am UTC](https://community.wolfram.com/t/dractic-slowdown-in-the-performance-of-table/25440 "2025-05-05T09:52:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodionstepanov](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rodionstepanov](https://community.wolfram.com/u/rodionstepanov)\
**Post date:** [May 5, 2025, 9:52am UTC](https://community.wolfram.com/t/dractic-slowdown-in-the-performance-of-table/25440/1 "2025-05-05T09:52:13Z")

</div>

Let’s initialize

```
a = Table[Random[], {1460}, {361}, {720}];

```

Then use some elements to form another table

```
Table[a[[1, i, 1]], {i, 1, 100}]; // AbsoluteTiming

```

This operation takes very little time

```
out[] = {0.0004528, Null}

```

But just a bit large Table (from 1 to **361** )

```
Table[a[[1, i, 1]], {i, 1, 361}]; // AbsoluteTiming

```

takes crazy long

out[]= {67.1042, Null}

What is a problem?

P.S. Mathematica ver. 13.3. RAM is sufficient.

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [May 5, 2025, 10:18am UTC](https://community.wolfram.com/t/dractic-slowdown-in-the-performance-of-table/25440/2 "2025-05-05T10:18:03Z")

</div>

I don’t know why the longer time, but this seems to be a workaround:

```
a[[1, 1 ;; 100, 1]]; // Timing
a[[1, All, 1]]; // Timing

```

---

<div class="post-metadata">

**Author:** ![rodionstepanov](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rodionstepanov](https://community.wolfram.com/u/rodionstepanov)\
**Post date:** [May 5, 2025, 11:05am UTC](https://community.wolfram.com/t/dractic-slowdown-in-the-performance-of-table/25440/3 "2025-05-05T11:05:48Z")

</div>

sure, there are many alternative ways to take elements but I need this Table because in fact the processing is much more complex (I don’t show all operations over `a[[1, i, 1]]`).

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [May 5, 2025, 1:54pm UTC](https://community.wolfram.com/t/dractic-slowdown-in-the-performance-of-table/25440/4 "2025-05-05T13:54:00Z")

</div>

The time is spent attempting to compile (I believe eventually with success) the last `Table` command because it has exceeded the default auto-compile length of 250. This involves, among other things, a full iteration over the table (I do not know all the details here).

`Table` can be dissuaded from doing this as below.

```
SetSystemOptions["CompileOptions"->"TableCompileLength"->Infinity];
a = Table[Random[], {1460}, {361}, {720}];

In[3]:= Table[a[[1, i, 1]], {i, 1, 100}]; // AbsoluteTiming

(* Out[3]= {0.000062, Null} *)

In[4]:= Table[a[[1, i, 1]], {i, 1, 361}]; // AbsoluteTiming

(* Out[4]= {0.000177, Null} *)

```

I will file a suggestion report that this handling be reconsidered with an eye toward optimizing it for better speed.

---

<div class="post-metadata">

**Author:** ![rodionstepanov](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rodionstepanov](https://community.wolfram.com/u/rodionstepanov)\
**Post date:** [May 5, 2025, 5:05pm UTC](https://community.wolfram.com/t/dractic-slowdown-in-the-performance-of-table/25440/5 "2025-05-05T17:05:06Z")

</div>

Great, it works! Thanks
