1 Reply Latest reply on Oct 31, 2010 9:45 AM by proyb

    Performance issue with NativeProcess

    proyb

      http://stackoverflow.com/questions/4063672/how-to-ensure-nativeprocess-read-line-by-line-w hen-the-output-is-return-by-java-c

       

      I like to understand the technical part of how capable is NativeProcess able to handle large result from Java program reading MIDI code in commandline, the MIDI data was running so fast that at least 1ms tick to update our UI like Piano keys will be important for our project. Is that way setting to push NP to read the data faster on average PC?

       

      If I were to read the whole midi data once and load into Flex application, I wonder what is the maximum limit that NP can read from output commandline? Can it read beyond 20,000 chars at once? I could not get it to read all the MIDI content at the moment. Please guide me.

       

      And here is my code to see what can be fine tuning...

       

      private function initial_MidiReader():void {

      var argMidi2:Vector.<String> = new Vector.<String>;
      var rescMidi2:String = File.applicationDirectory.nativePath + "/java/getMidiReader.jar";
      argMidi2.push("-jar",rescMidi2);
                     
      npInfoMidiOut = new NativeProcessStartupInfo();
      npInfoMidiOut.executable = new File("C:/Program Files/Java/jdk1.6.0_22/bin/java.exe");
                     
      npInfoMidiOut.arguments = argMidi2;
                     
      npMidiOut = new NativeProcess();
      npMidiOut.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onDeviceDataOut);
      npMidiOut.start(npInfoMidiOut);
      }

       

       

      for onDeviceDataOut code:

      TextBoxContent.text = npMidiOut.standardOutput.readUTFBytes(npMidiOut.standardOutput.bytesAvailable);