Coder Social home page Coder Social logo

Comments (6)

ebroecker avatar ebroecker commented on May 27, 2024

Hi @xRowe

Thanks for the analysis.

I had already a look but did not yet find the patch witch made it worse. I'll keep on searching

from canmatrix.

xRowe avatar xRowe commented on May 27, 2024

Hello @ebroecker

From my test, I found the below code takes much of time.
https://github.com/ebroecker/canmatrix/blob/d9902ace093fc1bb31af02599243847b529b0b44/src/canmatrix/formats/arxml.py#L1135C1-L1141C21

If I comment the code, the perfomance will be good.

Sorry, I am new on arxml, could not give some further investigate now

Thanks,
Rowe

from canmatrix.

ebroecker avatar ebroecker commented on May 27, 2024

Hi @xRowe
Thank you for this analysis.
So I know where to look at...

from canmatrix.

ebroecker avatar ebroecker commented on May 27, 2024

Hi @xRowe,

could you try branch https://github.com/ebroecker/canmatrix/tree/issue_750

pip install git+https://github.com/ebroecker/canmatrix/tree/issue_750

Maybe this little fix speeds up the parsing again

from canmatrix.

xRowe avatar xRowe commented on May 27, 2024

Hello @ebroecker
Thanks for your work,
As I check, Branch issue_750 created from official v1.0, with which cannot parse my arxml, but the latest development can do.
Traceback as below

Traceback (most recent call last):
  File "d:\Users\aaaa\Desktop\arxml\aaaa.py", line 45, in <module>
    dbc = load(arxml, decode_ethernet=True)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\Users\aaaa\Desktop\arxml\canmatrix\formats\arxml.py", line 2094, in load
    source_signal = ea.selector(source_triggering[0], "/I-SIGNAL-REF")
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\Users\aaaa\Desktop\arxml\canmatrix\formats\arxml.py", line 306, in selector
    return sorted(result_list, key=lambda element: element.sourceline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\Users\aaaa\Desktop\arxml\canmatrix\formats\arxml.py", line 306, in <lambda>
    return sorted(result_list, key=lambda element: element.sourceline)
                                                   ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'sourceline'

So I update the commited code to the latest development branch and have a try, below are the test result:
Time consumption: 2 ~ 2.1s
vs
https://github.com/ebroecker/canmatrix/blob/d9902ace093fc1bb31af02599243847b529b0b44/src/canmatrix/formats/arxml.py#L1135C1-L1141C21 is commented
Time Consumption: 1.7 ~ 1.8s

it is getting the signal.receivers

from canmatrix.

ebroecker avatar ebroecker commented on May 27, 2024

Hi @xRowe

thank you for testing!
issue_750 should be created from development, but I just now did an update of the branch. It should now depend on current development branch.

But anyway, you tried it, and it seems to fix the time-issue (more or less).
I'll do some cleanup and then merge it into development.

from canmatrix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.