Skip to content

Option for choosing queue.Queue over the multiprocessing queue? #1338

Open
@namoshizun

Description

@namoshizun

When setting enqueue=True, loguru sends log records to the writer thread through a multiprocessing queue, making the whole process non-blocking (nice! 😇).

I am wondering if it is possible to add an additional option to use the queue.Queue instead. This can reduce the loguru overhead on IoT devices, where the CPU power is extremely limited. On my device running Cortext A53, queue.Queue reduced the overhead per log from 2+ms to 0.9+ms. The multiprocessing queue also seemed to cause some unpredictable spike up to 20ms (approx once every 20 logs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions