Menu

Pocketsphinx multiple instance performance issue

Help
Alberto
2019-11-27
2019-11-27
  • Alberto

    Alberto - 2019-11-27

    Hi everyone,

    I am using pocketsphinx inside of a bash script to analise some wav files. The script runs on a Intel i7 with 8 cores and 16GB of RAM, with CentOS 7. My idea was to improve efficiency by executing several instances of the script concurrently, thinking that the performance would be maximised executing 8 instances at once (one on each core). However, after measuring the results, I am a little bit intrigued:

    1 instance takes 8s
    2 instances take 8.2s (4.1s/instance, OK)
    4 instances take 9.5s (2.37s/instance, OK) --> From here, no real performance improvement
    5 instances take 12s (2.4s/instance)
    6 instances take 15s (2.5s/instance)
    8 instances take 21.5s (2.72s/instance)
    10 instances take 26s (2.6s/instance)
    12 instances take 32s (2.66s/instance)
    14 instances take 41 (2,92/instance)

    As you can see, up to 4 concurrent instances, the performance keeps increasing, which is the expected behaviour, since each process is executed in its own core. However, from that point, the performance stalls, so it's even faster to execute 4 instances first and then an additional 4, rather than execute 8 instances simultaneously. I assumed (maybe wrongly), that since each instance would have its own core, the execution time would be basically the same as long as the number of instances wouldn't be higher than 8.

    I have removed everything from the script so only the call to "pocketsphinx_continuous" is executed, and I have seen on the Linux resource monitor that each instance is being executed on its own core indeed.

    Any idea if this behaviour is normal (maybe all the instances are using some shared resource that becomes a bottleneck)? Is there any way to improve the perfomance by using concurrency?

    Best regards

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.