Skip to content

[linux_can] filter fallback has performance implications but no warning is created #47

Description

@ethanrushh

Currently, no feedback (warning) is passed when the filter was unable to be applied to SocketCAN directly. On high-throughput applications, this will have a performance impact.

The offending code is in can_device.dart:

    controller.onListen = () {
      try {
        _addSocketFilter(filterEntry);
      } on CanFilterNotRepresentableException {
        // If we can't apply the filter, because it violates some SocketCAN restrictions,
        // we apply no filter at all and do the filtering in dart.
        // Happens for example when having and AND filter inside on OR filter,
        // or when we have too many rules.
        filterEntry = (CanFilter.any, emitErrors);
        _addSocketFilter(filterEntry);
      }

I think it would be a good idea to add some kind of warning or way to detect that this has happened.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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