<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57685>57685</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Parallelize ld.lld --compress-debug-sections=zstd
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          MaskRay
      </td>
    </tr>
</table>

<pre>
    [[ELF] Parallelize --compress-debug-sections=zlib](https://reviews.llvm.org/D117853) parallelized `--compress-debug-sections=zlib`. I have a pending patch to parallelize `--compress-debug-sections=zstd` with zstd API: https://reviews.llvm.org/D133679 

@Cyan4973 it will be great to have your input on how to use the parallel zstd API :)

A program using `ZSTD_CCtx_setParameter(cctx, ZSTD_c_nbWorkers, th)` + `ZSTD_compressStream2` appears slower than the zstd cli (compiled from the same build). I do not know whether it's the program is async reading (which is difficult to leverage in the linker) or other feature I have missed.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNU1FvmzAQ_jXwckoEdoDwwEOarFKlTarWSZP2Uhl8gBeDkW2Spr9-h9um3cs6CYHsu_vu--4-aiMvVZTd0PPl622UHeBeWKE1avWMsFo1ZpgsOreSWM_dymHjlRldxA_PWtWUH7Ft7_1EN7uI3dJj8aTw7NZan4a1sR1dHdK02GY8YiVM7-gSojz5tEOerOEOenFCEDDhKNXYEYpvevDmI9ynaM5LSoGz8j0sB9jd3xFr-A_6nOdFCVFyiJLd63uT7C9i3JQFB-UJVGuoETqLwi_EAuGLmS2ocZo9mBF6c14is0PwPV6pX7lA4FB-7LKDyZrOioGqFt3E_9fDj8Pjfu-fHh36ZVcDerS0habxTxHbQ0hoHsf6p7FHtG658_0CTOIjdnMFeRvVgyfSA1vCYppQWAdOmzNaKhNj4BooNlrB0ofKlKbttdYMIeqIA9Sz0pK6LNuSBkbj4TiS4nOPlENj8BEr3IvyV03KgXCXsQHqH9ZK6Ode0WYpIlXbqmbWYZoaT2hFhzTMgKDVeFxEl2AsmIDf0uBni29eGZRzKNcxVmmes3LDyiKLZcVlyUsRe-U1Vh-driVtXP7b8DSEeLa6-tswHflprtdUR4fFNa-fFcn8TdV0JC4z0iJusyLfZnFfodwkLbIcUSQptimvBedpzlq5FcgZxlrUqN3Lj3mIVcUSxpIyZUnC8zRbN2mTcZY021TwrCw25EYchNJX18a2ChxIgqOgVs6_WzoWzqluRHzDF7Pvja2-CXf8Li5xoFsFrn8AxoRbsQ">