# \#folds

**URL:** https://discourse.julialang.org/tag/folds/1051.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Multi-threading Heisenbug: code is faster when profiled](https://discourse.julialang.org/t/multi-threading-heisenbug-code-is-faster-when-profiled/133805)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 5\
**Last updated:** [November 28, 2025, 2:01pm UTC](https://discourse.julialang.org/t/multi-threading-heisenbug-code-is-faster-when-profiled/133805 "2025-11-28T14:01:26Z")

</div>

I have some trivially parallelizable for loops that I wanted to speed up using multi-threading, namely using Folds.jls Folds.foreach(). I started julia with julia -t 8 to get one interactive thread and 8 worker threads a…

---

## [Solving this without a loop (learning purposes)](https://discourse.julialang.org/t/solving-this-without-a-loop-learning-purposes/103013)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 14\
**Last updated:** [August 21, 2023, 12:46am UTC](https://discourse.julialang.org/t/solving-this-without-a-loop-learning-purposes/103013 "2023-08-21T00:46:23Z")

</div>

I’m trying to get more familiar with using Transducers.jl or related functions that avoid loops - just to learn. Let’s say I have this simple vector x = Bool\[1,1,0,0,1,1,0,1\] and I want to find the indices of adjacent …

---

## [Comparing Folds/FLoop Executors](https://discourse.julialang.org/t/comparing-folds-floop-executors/91649)

<div class="topic-metadata">

**Author:** [@markowkes](https://discourse.julialang.org/u/markowkes)\
**Replies:** 0\
**Last updated:** [December 14, 2022, 5:16pm UTC](https://discourse.julialang.org/t/comparing-folds-floop-executors/91649 "2022-12-14T17:16:53Z")

</div>

I wrote the following code to test the various executors profited by Floops.jl and FoldsThreads.jl to distribute work between multiple threads. The code creates work (of various sizes) and distributes this work amongst …

---

## [Break statement in foldscuda/floops is giving error](https://discourse.julialang.org/t/break-statement-in-foldscuda-floops-is-giving-error/89864)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 4\
**Last updated:** [November 11, 2022, 10:23am UTC](https://discourse.julialang.org/t/break-statement-in-foldscuda-floops-is-giving-error/89864 "2022-11-11T10:23:15Z")

</div>

Hi everyone, I am trying to use Floops, and FoldsCuda library as an alternative to OpenACC in Cuda c++, and Fortran in Julia. Consider the following code using Random, CUDA, FLoops, Test, FoldsCUDA function main() …

---

## [Type instability in Folds.map](https://discourse.julialang.org/t/type-instability-in-folds-map/84080)

<div class="topic-metadata">

**Author:** [@MattSainsbury-Dale](https://discourse.julialang.org/u/MattSainsbury-Dale)\
**Replies:** 0\
**Last updated:** [July 12, 2022, 3:54am UTC](https://discourse.julialang.org/t/type-instability-in-folds-map/84080 "2022-07-12T03:54:28Z")

</div>

Hello, I’ve noticed that the Folds version of map() seems to introduce type instability: using Folds f1(K::Integer) = map(identity, 1:K) f2(K::Integer) = Folds.map(identity, 1:K) @code\_warntype f1(5) @code\_warntype f…

---

## [How to improve type-inference in Folds.map?](https://discourse.julialang.org/t/how-to-improve-type-inference-in-folds-map/82040)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [June 1, 2022, 8:59am UTC](https://discourse.julialang.org/t/how-to-improve-type-inference-in-folds-map/82040 "2022-06-01T08:59:33Z")

</div>

Eg julia\> @code\_warntype Folds.map(1:10) do i i^2 end MethodInstance for Folds.map(::var"#3#4", ::UnitRange{Int64}) from map(f, itr; kwargs...) in Folds.Implementations at /home/jishnu/.julia/packages/Fo…
