Imagine a 12mm Data.Table.
I want to
create a new column and compute a new value using a complex algo using data only from the row.
break the 12mm rows into 1mm sections and have 1 cpu thread handle each of the 12x 1mm chunks (its a multi-core, 12 thread CPU).
This means 12 threads will iterate through their section of the data.table, read data from a row, compute a value and store it in a different column in the row.
Note:
- the new column is being created before multi-threading
- each thread is accessing a different part of the data.table by index
- the function is too complex to do another way
- right now the processing is sequentialthrough the data.table, only uses one CPU thread and runs for other 3 hours.
Q: What's a better way to increase "same machine" concurrency with 12mm rows using complex functions? Q: what's broken with this scenario?