# Parallel Computing with Threads.@threads in HPC is slow?

**URL:** https://discourse.julialang.org/t/parallel-computing-with-threads-threads-in-hpc-is-slow/112591
**Category:** Performance
**Created:** [April 6, 2024, 12:32am UTC](https://discourse.julialang.org/t/parallel-computing-with-threads-threads-in-hpc-is-slow/112591 "2024-04-06T00:32:54Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [April 6, 2024, 2:42am UTC](https://discourse.julialang.org/t/parallel-computing-with-threads-threads-in-hpc-is-slow/112591/3 "2024-04-06T02:42:34Z")

</div>

Hello!

Welcome to the forum 😊

Perhaps you could post a more detailed example following the guide here [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757) ?

Looking at your code I am guessing that one reason could be that your problem is so small, that it is not gaining the full advantage of 256 threads due to communcation overhead, perhaps you are not re-using memory correctly, so each iteration is allocating a lot, slowing down the code and perhaps the way you index into `FE.edofMat[e,:]` is not efficient and you should use a `@view`.

---

_[View the full topic](https://discourse.julialang.org/t/parallel-computing-with-threads-threads-in-hpc-is-slow/112591)._
