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

High Cost of first query using OrientGraphFactory #122

Open
du00cs opened this issue Mar 1, 2017 · 1 comment
Open

High Cost of first query using OrientGraphFactory #122

du00cs opened this issue Mar 1, 2017 · 1 comment
Assignees
Labels

Comments

@du00cs
Copy link

du00cs commented Mar 1, 2017

Hi, I notice that there are high cost of first query using OrientGraphFactory.

OrientGraph g = factory.getNoTx();
List<Object> list = g.traversal().V()...toList();
g.close();

First query will exceed 100ms in my test,
getNoTx cost 517ms
g.traversal().V()...toList() cost 266ms.

How can I improve the performance?

@wolf4ood wolf4ood self-assigned this Aug 7, 2017
@Usnul
Copy link

Usnul commented Sep 8, 2017

likely class loader is to blame. Java will only load classes when they are being used, meaning when you instantiate an object with large class hierarchy behind it - it will take a lot of time. Try:

OrientGraph g0 = factory.getNoTx(); //force class loader
OrientGraph g = factory.getNoTx(); //<- measure this
List<Object> list = g.traversal().V()...toList();
g.close();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants