# Each Parallel issue

**URL:** <https://forum.kx.com/t/each-parallel-issue/13411>\
**Category:** Community Support\
**Tags:** imported, kdb-and-q\
**Created:** [August 29, 2022, 12:00am UTC](https://forum.kx.com/t/each-parallel-issue/13411 "2022-08-29T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![k-mambo](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/k-mambo/32/128_2.png) [@k-mambo](https://forum.kx.com/u/k-mambo)\
**Post date:** [August 29, 2022, 12:00am UTC](https://forum.kx.com/t/each-parallel-issue/13411/1 "2022-08-29T00:00:00Z")

</div>

[https://learninghub.kx.com/forums/topic/each-parallel-issue](https://learninghub.kx.com/forums/topic/each-parallel-issue)

Follows [https://code.kx.com/q/basics/peach/](https://code.kx.com/q/basics/peach/"),

_The result of `m’:` is exactly the same as `m’`. If no secondary tasks are available, performance is the same as well._

but m’: more fast and less memory used. Is not m’ parallel execuation??..

---

<div class="post-metadata">

**Author:** ![rocuinneagain](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/rocuinneagain/32/287_2.png) [@rocuinneagain](https://forum.kx.com/u/rocuinneagain)\
**Post date:** [August 29, 2022, 12:00am UTC](https://forum.kx.com/t/each-parallel-issue/13411/2 "2022-08-29T00:00:00Z")

</div>

`m’` is not parallel execution

&nbsp;

There can be cases where the overhead of using multiple threads can make execution slower than single threaded. (.i.e performing many small operations)

`.Q.fc` is available to help in some of these cases.

[https://code.kx.com/q/ref/dotq/#qfc-parallel-on-cut](https://code.kx.com/q/ref/dotq/#qfc-parallel-on-cut")

&nbsp;

If you measure memory usage with `ts` note that it only sees usage in main thread. It does not sum usage from all threads. So you cannot compare results directly.

&nbsp;

```
q)\ts {til 10000000;x}'[til 1000] // \ts shows real memory usage 
5395 134250848 
q)\ts {til 10000000;x}':[til 1000] // \ts only sees memory usage in main thread - not the sum of threads 
5612 33408
```

&nbsp;

```
q)\ts {x}'[til 100000] // Single core 
8 4746288 

q)\ts {x}':[til 100000] // Slower due to parallel overhead 
13 4194864 

q)\ts .Q.fc[{x}][til 100000] //Faster way to use multiple cores 
1 3146512
```

&nbsp;

&nbsp;
