-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix escaping. #58
Fix escaping. #58
Conversation
@@ -279,6 +301,7 @@ module.exports = class NQuads { | |||
literal: TYPE_LITERAL | |||
}; | |||
|
|||
// FIXME escape |
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.
Note to self: determine how to test this path and handle escaping as needed.
If there is a significant performance hit as you say, I think we will want to benchmark an option that does a quick scan for the need to escape control chars, etc. -- and only if it is needed does it run. Having such an option include that kind of information in the output as some meta data would also be helpful in the canonize algorithm because it could cause a switch in the comparator function as well (fast native string compare vs. explicit custom unicode code point compare). |
5b46a6c
to
66e895e
Compare
4b957ff
to
7b2c32d
Compare
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main-with-3.4.0 #58 +/- ##
==================================================
Coverage ? 90.09%
==================================================
Files ? 10
Lines ? 626
Branches ? 0
==================================================
Hits ? 564
Misses ? 62
Partials ? 0 |
e7d78c0
to
453dad7
Compare
**BREAKING**: Use latest rdf-canon N-Quads canonical form. This can change the canonical output! There is an expanded set of control characters that are escaped as an `ECHAR` or `UCHAR` instead of using a native representation.
- Use a pre-computed map of replacement values. - Performance difference depends on the number of replacements. The rdf-canon escaping test showed up to 15% improvement.
Merging to main staging branch along with the testing updates to have a testable base for other work. |
NOTE: Escaping causes a serious performance regression with the initial version here. An optimization and benchmarks are forthcoming in another PR. This checkpoint is here for comparison and testing.
Tests available: w3c/rdf-canon#81