# P2 USB Serial is very slow compared to Photon

**URL:** <https://community.particle.io/t/p2-usb-serial-is-very-slow-compared-to-photon/63270>\
**Category:** Device OS\
**Created:** [October 4, 2022, 12:08pm UTC](https://community.particle.io/t/p2-usb-serial-is-very-slow-compared-to-photon/63270 "2022-10-04T12:08:06Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![sebkopf](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@sebkopf](https://community.particle.io/u/sebkopf)\
**Post date:** [December 18, 2023, 8:25pm UTC](https://community.particle.io/t/p2-usb-serial-is-very-slow-compared-to-photon/63270/13 "2023-12-18T20:25:39Z")

</div>

Hi @rickkas7

I was wondering if there has been any updates on this issue?

Comparing the serial output between Photon 2 and Photon 1, I still get a \> 20 fold slow down in Photon 2 vs 1 with \> 5ms compared to ~250 µs (details below) for a log message. I'm assuming this is still the same buffer issues you explained in this thread and was hoping there might be a way for solving this more generally, Or if not, could you kindly point out a good way to use your solution with the `SerialLogHandler` (recommend instead of `Serial` in the particle docs)? Note on context: running a stepper motor at a range of speeds up to pretty fast rates (requiring ~1 step / ms) which used to be no problem but now the Serial debug messages cause the stepper to skip.

Thank you for all your help!

Photon 2 (firmware v. 5.6.0):

```auto
0000010907 [app] INFO: log message took 5563 microseconds
0000011913 [app] INFO: log message took 5723 microseconds
0000012918 [app] INFO: log message took 5370 microseconds
0000013924 [app] INFO: log message took 5310 microseconds
0000014929 [app] INFO: log message took 5520 microseconds

```

Photon 1 (firmware v. 2.3.1):

```auto
0000008089 [app] INFO: log message took 220 microseconds
0000009090 [app] INFO: log message took 225 microseconds
0000010090 [app] INFO: log message took 220 microseconds
0000011090 [app] INFO: log message took 261 microseconds
0000012090 [app] INFO: log message took 220 microseconds

```

Generated with this slightly adapted version of your code:

```auto
#include "Particle.h"

SYSTEM_THREAD(ENABLED);

SerialLogHandler logHandler;

void setup() {

}

void loop() {
    static unsigned long lastRun = 0;
    unsigned long start = micros();
    Log.info("log message took %lu microseconds", lastRun);
    lastRun = micros() - start;
    delay(1000);
}

```

---

_[View the full topic](https://community.particle.io/t/p2-usb-serial-is-very-slow-compared-to-photon/63270)._
