Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 code seems shockingly inefficient #440

Closed
2 tasks
joernhees opened this issue Nov 27, 2014 · 3 comments
Closed
2 tasks

python3 code seems shockingly inefficient #440

joernhees opened this issue Nov 27, 2014 · 3 comments
Assignees
Milestone

Comments

@joernhees
Copy link
Member

Comparing the typical travis run times of py2 and py3 tests it seems py3 is on avg. taking 2x as long.
This only partially seems to be due to the 2to3 runs and a wild guess of me is that it has to do with some items() -> list(items()) transformation.

It seems this becomes most apparent in this test:

Python3.4: 86 seconds

test.test_dawg.test_dawg(RDFTest(uri=rdflib.term.URIRef('http://www.w3.org/2009/sparql/docs/tests/data-sparql11/syntax-update-2/manifest#syntax-update-other-01'), name='syntax-update-other-01', comment=None, data=None, graphdata=None, action='file:///home/travis/build/RDFLib/rdflib/build/src/test/DAWG/data-sparql11/syntax-update-2/large-request-01.ru', result=None, syntax=True),): 86.3655s

Python2.7: 49 seconds

test.test_dawg.test_dawg(RDFTest(uri=rdflib.term.URIRef(u'http://www.w3.org/2009/sparql/docs/tests/data-sparql11/syntax-update-2/manifest#syntax-update-other-01'), name=u'syntax-update-other-01', comment=None, data=None, graphdata=None, action=u'file:///home/travis/build/RDFLib/rdflib/test/DAWG/data-sparql11/syntax-update-2/large-request-01.ru', result=None, syntax=True),): 49.0514s

Todos:

  • check why test is so slow in general (profiler-runs)
  • check if it can be decomposed
@joernhees joernhees self-assigned this Nov 27, 2014
@joernhees joernhees added this to the rdflib 5.0 milestone Nov 27, 2014
@joernhees joernhees modified the milestones: rdflib 5.0.0, rdflib 6.0.0 Jan 28, 2016
@gromgull
Copy link
Member

Here: py2 test in 2m09s - py3 in 4-6 minutes :(

https://travis-ci.org/RDFLib/rdflib/builds/196356635

(ignoring that one test failed, it's unrelated)

@gromgull
Copy link
Member

They are comparable now: https://travis-ci.org/RDFLib/rdflib/builds/447210434

@ashleysommer
Copy link
Contributor

This was closed as resolved, (I don't know if it resolved itself over time, with updates in Python3, or a fix was made in rdflib). I'm changing milestone from 6.0.0 to 5.0.0 for inclusion in the 5.0.0 changelog.

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

No branches or pull requests

3 participants