Insert query is very slow


insert query in java is very slow .
for example
"insert $x isa person " -------> 700 ms
"insert $x isa person has name “emad” " -------->2-3 s
"insert $x isa perons has name “emad” has firstsname “emad” has lastname “emad”" 3-5 s
is that ok? it is very slow not it? is there a problem ? or is it the normal speed for insert in grakn?
please help me


That is slower than we experience here in the office. Can you give me an idea of the hardware you are using?



i am using hp omen series and it is very powerful. intel core i7 CPU , 16 gigabyte RAM .
here is my java code :

GraknSession graph1 = Grakn.session(“localhost:4567”, “new”);
GraknGraph innerGraph =;
QueryBuilder qb1 = innerGraph.graql();
long x = System.currentTimeMillis();
qb1.parse(“insert $x isa person has name “person3” ;”).execute();
long y = System.currentTimeMillis();

the output in terminal :



Sorry it took a little while to get round to answering this one. I ran this modified test:

    public void slowQuery() {
        try (GraknSession session = Grakn.session("localhost:4567", "new")) {
            long x = System.currentTimeMillis();
            try (GraknGraph graph = {
                ResourceType<String> name = graph.putResourceType("name", ResourceType.DataType.STRING);
            long y = System.currentTimeMillis();
            System.out.println(y - x);
            x = System.currentTimeMillis();
            for (int i=0;i<100;i++) {
                try (GraknGraph graph = {
                    QueryBuilder qb1 = graph.graql();
                    qb1.parse("insert $x isa person has name \"person3\" ;").execute();
            y = System.currentTimeMillis();
            System.out.println(((double) (y - x))/100);

And get these two times output: 16962, 28.28. You can see that there is some overhead when you open the graph for the first time within the session, but subsequent writes are much faster.