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

JsonLdProcessor.Frame(...): poor performance on large sets of objects #31

Closed
dtivel opened this issue Jul 3, 2018 · 2 comments
Closed

Comments

@dtivel
Copy link
Collaborator

dtivel commented Jul 3, 2018

Version 1.0.4

From http://www.w3.org/TR/json-ld-api/#node-map-generation:

6.6.6.2) Otherwise, compare reference against every item in the array associated with the active property member of node. If there is no item equivalent to reference, append reference to the array. Two JSON objects are considered equal if they have equivalent key-value pairs.

This is implemented in json-ld.net as an n-squared algorithm, where n is the number of elements in the set. JsonLdProcessor.Frame(...) calls JsonLdApi.GenerateNodeMap(…), which for each element in an array calls JsonLdUtils.MergeValue(…), which in turn calls JsonLdUtils.DeepCompare(…) on the current set.

@dtivel dtivel changed the title JsonLdProcessor.Frame(...): poor performance on large sets JsonLdProcessor.Frame(...): poor performance on large sets of objects Jul 3, 2018
@dtivel
Copy link
Collaborator Author

dtivel commented Jul 3, 2018

Repro: build and run this project: JsonLdRepro.zip

@goofballLogic
Copy link
Member

This should be considered in connection with #60

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

No branches or pull requests

2 participants