Speedup Literal.hash and Literal.eq by accessing directly _da… by rchateauneu · Pull Request #1321 · RDFLib/rdflib (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation8 Commits2 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

rchateauneu

Literal.hash and Literal.eq use self.datatype and self. language properties. It is faster to directly use the private members Literal._dataype and Literal.__language.

Test importing orkg.nt

Before:
image

After:

image

@rchateauneu

@coveralls

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

4 similar comments

@coveralls

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@coveralls

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@coveralls

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@coveralls

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@coveralls

Coverage Status

Coverage remained the same at 75.705% when pulling 42c90d9 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@rchateauneu

It failed only Python 3.7, but 3.6 and 3.8 worked OK. This is strange because the changes are very simple.

The failed test is:

ERROR: test_query_with_added_rdf_prolog (test.test_sparqlstore.SPARQLStoreDBPediaTestCase)
...
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address

I tend to think that it is a transient error related to a temporary network problem.

Is it possible to rerun a build on the same PR ?

@rchateauneu

This was referenced

May 21, 2021

nicholascar

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about the "cannot assign address" test failure you're noticing: that's spurious and won't prevent this PR going through.