2

I know only one, the cycle.js from Crockford's JSON-JS, but it is recursive and appears very slow, it take 2-5 seconds to JSON.stringify(JSON.decycle(random_graph_with_30_vertices)) and hit recursion depth limit for larger graphs. Are there better non-recursive alternatives?

1 Answer 1

5

Try Cereal

It is not recursive. The output format is less readable, but it's still actually JSON. I believe it's fairly fast, but I've not benchmarked it against cycle. It has been used in anger in a few projects. It also solves more than just cycle-detection which may or may not be to your liking.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.