This is the culprit. you overwrite nn which is an Int and later a float. changing the second nn to another name recovers the performance lost
Declaring variables inside a for loop using Threads.@threads has a significant impact on performance
3 Likes