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

BlueprintsPersistenceBackend#createVertex(PersistentEObject) is not efficient #72

Closed
gdaniel opened this issue Mar 24, 2017 · 1 comment

Comments

@gdaniel
Copy link
Contributor

gdaniel commented Mar 24, 2017

This method delegates to IdGraph#addVertex(Object) that checks that the ID doesn't exist by iterating all the nodes in the database, and then creates the new element.

We can avoid this useless iteration (NeoEMF IDs are unique) by telling the backend it should not worry about ID uniqueness. IdGraph#enforeUniqueIDs(boolean) can help.

@gdaniel gdaniel added this to the Release 1.1.0 milestone Mar 24, 2017
@yvrng
Copy link
Contributor

yvrng commented Jun 7, 2017

This behavior has been defined in the constructor of AbstractBlueprintsBackend#InternalIdGraph.

But we have to be careful: uniqueness cannot be guaranteed when creating a new Id.
However, the probability of collision is assumed to be very low (UUID Collisions)

We need to make sure that EcoreUtil#generateUUID() generates a valid UUID, because it looks shorter (and therefore less safe) than the result of UUID.generate(). According the the documentation, it generate a 128-bit UUID, it's maybe sufficient.

@yvrng yvrng modified the milestone: Release 1.1.0 Jun 9, 2017
@yvrng yvrng closed this as completed Feb 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants