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

do not use current time in sparql TIMEZONE #1193

Merged
merged 3 commits into from Dec 28, 2020

Conversation

FlorianLudwig
Copy link
Contributor

Calculating the timezone should use date date and time from the
datetime object the timezone is requested from instead from the
current time. This makes a difference if the timezone for the given
location has changed in the past. In this particular case it is probably
not possible as iso 8601 seems not have a method to specify the
time zone via a location.
Therefore this cleans up unnecessary code and removing the
call to now in every sparql context creation gives a nice
performance increase.

Speedup varies depending on benchmark between 3% and 12%

(To be honest I am surprised myself with those 12% but could reproduce the result)

Calculating the timezone should use date date and time from the
datetime object the timezone is requested from instead from the
current time. This makes a difference if the timezone for the given
location has changed in the past. In this particular case it is probably
not possible as iso 8601 seems not have a method to specify the
time zone via a location.
This improves performance when doing a lot of small queries.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 75.499% when pulling 63b756f on FlorianLudwig:sparql-timezone into dde9db8 on RDFLib:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 75.499% when pulling 63b756f on FlorianLudwig:sparql-timezone into dde9db8 on RDFLib:master.

@coveralls
Copy link

coveralls commented Oct 24, 2020

Coverage Status

Coverage increased (+0.01%) to 75.477% when pulling 0f191ae on FlorianLudwig:sparql-timezone into 009dc24 on RDFLib:master.

@FlorianLudwig
Copy link
Contributor Author

@nicholascar could you also have a look at this merge request? It is rather small :) It is just about making now in queries lazy.

@nicholascar nicholascar merged commit 6c294aa into RDFLib:master Dec 28, 2020
@white-gecko white-gecko added this to the rdflib 6.0.0 milestone Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants