You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Martynas Jusevičius <ma...@graphity.org> on 2015/10/19 15:46:46 UTC

PropertyTable performance

Hey,

am I using PropertyTable right? I was expecting a performance increase
since it is a lower-level API compared to storing Statements and/or
RDFNode in a matrix -- but it seems to perform much slower. This is my
code:

for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) {
  String key = columns[columnIndex].getKey();
  Node property = NodeFactory.createLiteral(key);
  Column column = table.createColumn(property);
}

for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) {
  Node subject = NodeFactory.createBlankNode();
  Row row = table.createRow(subject);

  for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) {
    String key = columns[columnIndex].getKey();
    Node property = NodeFactory.createLiteral(key);
    Column column = table.getColumn(property);
    row.setValue(column, subject);
  }
}

Does that look right? I am testing on 200000 rows and 22 columns and
after ~10 minutes this code hasn't completed yet.

Martynas