-
Notifications
You must be signed in to change notification settings - Fork 558
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
Speedup with Cython and Turtle parsing. #1263
Conversation
2 similar comments
rdflib/plugins/parsers/notation3.py
Outdated
i = i + 1 | ||
else: | ||
break | ||
#ln = c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove unused code
@@ -1570,8 +1585,8 @@ def strconst(self, argstr, i, delim): | |||
if ch == delim1: | |||
j = i | |||
continue | |||
elif ch in ('"', "'") and ch != delim1: | |||
ustr = ustr + ch | |||
elif ch in "\"'" and ch != delim1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me the original looks more readable and - at least in cpython - it is actually faster. Didn't test cython though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed the effect of replacing "x = x + y" by "x += y" is very small. However, other changes such as qname() and skipSpace() have a significant effect on my platform.
Overall this looks like a good MR to me. A lot of cleanup and cython 👍 I am curious why travis fails on powerpc - I cannot see any errors in the logs. Is it just me being blind? |
It might be a good idea to split this up into two merge requests, one for the cleanup of the python code and one for setting up cython. |
Yes, why not. I am discovering rdflib code, so sorry for these errors. Please do not hesitate to separately take any change you think is worth. |
And, I restored setup.py to what it was, and I get the same error message on ppc only: warnings.warn("NTSerializer does not use custom encoding.") /home/travis/build/rchateauneu/rdflib/rdflib/plugins/serializers/nquads.py:24: UserWarning: NQuadsSerializer does not use custom encoding. warnings.warn("NQuadsSerializer does not use custom encoding.") ..... No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself. Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received |
@ddeka2910 can you help here? |
@ddeka2910 I have recreated a new clone from scratch, but the problem still happens. Please see the build here: |
I have converted this one to a draft as the turtle parsing part is covered in #1266 and this one should be changes to only cover the cython improvements. |
If you want, I will resend a specific PR for Cython, with changes only for setup.py . |
That would be great |
Fixes #
Proposed Changes