Overhead cost of spawning child processes


I am curious as to the overhead cost of spawning child processes using fork in a Linux environment. Suppose I have a C program such as

void run_computation(int x);  int main() {     for (int k=0; k<10; k++) {         if ( fork() == 0 ) {             run_computation(k);             break;         }     }      return 0; } 

Assuming that no global state is modified by run_computation, how efficient in terms of overhead is the setting up of the child processes?

To help understand where I’m coming from, I’d like to write my own regex engine (for self-learning) and am imagining using fork to implement the NFA. So, am I incurring an unreasonable cost in such an implementation compared to other methods?