Are there alternatives to system() that might be more performant for CGI scripts on embedded Linux?

I'm facing a performance issue with the system() call in C on my embedded Linux system. The command I'm running which is a network ping or a file system operation executes quickly when I run it directly on the command line. However, when I call the same command from within a compiled CGI script using system(), it becomes significantly slower from milliseconds to seconds. What are some potential reasons why system() might be slower than running the command directly? Are there any alternatives to system() that might be more performant for CGI scripts on embedded Linux? @Middleware & OS
3 Replies
Sterling
Sterling6mo ago
Uhhmm, @Dtynin why don't you try using tools like strace or perf to profile your CGI script so you can pinpoint where the delays are happening.
Marvee Amasi
Marvee Amasi6mo ago
@Sterling you have started utilizing strace ryt
Sterling
Sterling6mo ago
Yeah, I have ... The suggestion by @Dtynin earlier with the Latency problem really helped
Want results from more Discord servers?
Add your server