Here is the orchestra for the test sr = 44100 ksmps = 1 nchnls = 1 instr 1 endin and there are 20000 events in the score with at = dur = 0.001 i1 0 0.001 i1 + . ... The total dur is 20 seconds. The shell script to generate it is seq 0 0.001 20 | xargs -i echo i1 {} 0.001 > test.sco # current csound csound test.orc test.sco ... Elapsed time at end of performance: real: 8.045s, CPU: 7.950s ... # csound 5.14.2 csound test.orc test.sco ... Elapsed time at end of performance: real: 0.506s, CPU: 0.340s ... # current scsort time scsort < test.sco ... real 0m4.333s user 0m3.929s sys 0m0.053s # scsort with 5.14.2 time scsort < test.sco ... real 0m0.438s user 0m0.099s sys 0m0.063s I have found a solution for `scsort' modifying the `fltout' function in Engine/swritestr.c static void fltout(CSOUND *csound, MYFLT n) { char *c, buffer[1024]; sprintf(buffer, "%.6f", n); for (c = buffer; *c != '\0'; c++) corfile_putc(*c, csound->scstr); } that is faster than `corfile_puts(buffer, csound->scstr)'. The new result is # current scsort + fix time scsort < test.sco ... real 0m0.444s user 0m0.100s sys 0m0.047s Yeah, one is gone (not applied, let me know if it is good for you). However, after the sorting, we still have csound test.orc test.sco ... Elapsed time at end of performance: real: 3.830s, CPU: 3.780s ... Only few informations with `strace'. There is a `select' call in the csoundInternalYieldCallback (probably from fltk) but it is not the cause because I have bypassed it. Mystery for now. You looks at the results if we maintain the number of the events but with largest durations: ----- at = dur = 0.01 20001 events ----- # csound current + scsort fix ... Elapsed time at end of performance: real: 4.583s, CPU: 4.530s ... # csound 5.14.2 ... Elapsed time at end of performance: real: 1.324s, CPU: 1.300s ... ----- at = dur = 0.1 20001 events ----- # csound current + scsort fix ... Elapsed time at end of performance: real: 9.686s, CPU: 9.530s ... # csound 5.14.2 ... Elapsed time at end of performance: real: 9.667s, CPU: 9.590s ... tito ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net