There might be something odd about your script, but in any case, only root can raise the priority of a process above the default for the non-root user.
In some cases, if the amt of data in each rec is small, you may be 'suffering from buffering' eg
http://perl.plover.com/FAQs/Buffering.html. That page talks about Perl, but the principle is the same regardless of language.