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

Performance #87

Closed
whitlockjc opened this issue Jun 15, 2016 · 2 comments
Closed

Performance #87

whitlockjc opened this issue Jun 15, 2016 · 2 comments

Comments

@whitlockjc
Copy link
Owner

Fixing issue #82 was a brute force attempt. With all the feature adds and bug fixes, it's time to revisit performance.

@noahdietz
Copy link

noahdietz commented Sep 5, 2016

So how much of a difference did the first pass make at improving performance?

Idk if it'd make much of a difference, but you're using arrays, and searching the entire array each time for a previously visited reference. Unless you limit the depth of the circular relationship, this will become the slowest aspect I think, and predictably so...I'm not entirely sure, but could using a Javascript object as a map, keyed by refPtr, make searching (access runtime) for an already visited refPtr faster?

Also, does limiting the traversal depth help here? or making it configurable maybe? Eventually you have to stop evaluating a circular dependency, I'm just wondering what your stopping point is.

@whitlockjc
Copy link
Owner Author

The real problem is processing the same documents and references more than once. I've solved this locally. The other problem is the approach taken to identify circular references and for resolving the references. Instead of finding all references and working out if they are circular or not, I need to process each reference once, identify its dependencies (what other referenceable objects are below the referenced object), resolve references as they are encountered and use simple logic to identify circulars after the fact.

I've got it all figured out, and most of it worked out locally. I just need to finish the work.

whitlockjc added a commit that referenced this issue Apr 20, 2017
The resolver was rewritten to fix numerous bugs and performance issues.
The reason for this is over the years, bug fixes and features have been
added on top of json-refs and its resolver logic has become crufty.  The
new rewrite is clean, does not reinvent the wheel and fixes many bugs.

Fixes: #80, #87, #88, #89, #97, #101, #103
whitlockjc added a commit that referenced this issue Apr 20, 2017
The resolver was rewritten to fix numerous bugs and performance issues.
The reason for this is over the years, bug fixes and features have been
added on top of json-refs and its resolver logic has become crufty.  The
new rewrite is clean, does not reinvent the wheel and fixes many bugs.

Fixes: #80, #87, #88, #89, #97, #100, #101, #103
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