Posts: 2
Joined: Mon Feb 19, 2018 2:35 pm

Degraded USB Serial Performance

Mon Feb 19, 2018 4:52 pm

I have a custom developed Java application that has run for a long time on Raspbian Jessie (May 27, 2016 release). This application talks to some external hardware over an RS-485 connection using an FTDI USB to serial/485 adapter. The connection runs reliably at 115,200 baud, and the application is able to perform a complete processing cycle with the external hardware in less than 20mS, or in excess of 50 processing cycles per second. It will actually run faster, but I throttle it back to 50 cycles per second.

After upgrading to Raspbian Stretch (November 29, 2017 release) I observed a severe performance degradation. The connection still runs reliably at 115,200 baud, but I can only achieve about 30 processing cycles per second. The hardware configuration has not changed in any way. I'm even using the same MicroSD card. The configuration of the custom software application is also the same, and the same .jar file is being used. I can restore a backup of the Jessie image and return to the previous higher performance levels.

There is also no detectable difference in the amount of CPU time being consumed when running the application on Jessie versus Stretch. CPU time consumed while the application is running is in single digits under both Jessie and Stretch. The application just cycles slower on Stretch.

In these tests the Pi is running headless using TightVNC and a virtual display (only) with Jessie, and RealVNC remoting the physical display with Stretch (although no physical display is attached). As a spot test I downloaded the July 5, 2017 Raspbian distribution, which I believe was still Jessie but had an updated kernel and firmware as well as RealVNC, and it also exhibits the lower performance level of 30 cycles per second. So something that changed between the May 27, 2016, and July 5, 2017, releases appears to result in this lower performance. But what?

Is there anything I can do to restore my previous performance level while still updating to the latest Raspbian distribution? Are there any settings, or driver or firmware updates, that might resolve this performance degradation? Or must I choose between current distributions and performance?

Any answers or insights appreciated.

User avatar
Posts: 5251
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Degraded USB Serial Performance

Wed Feb 21, 2018 2:21 pm

What version(s) of JRE are in these installations ?

Posts: 2
Joined: Mon Feb 19, 2018 2:35 pm

Re: Degraded USB Serial Performance

Wed Feb 21, 2018 10:10 pm

In both instances java -version reports:

java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)

There is no difference in Java versions between the two configurations.

Return to “Interfacing (DSI, CSI, I2C, etc.)”