Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-178

SPARQL Results serialization is slow for some formats with large result sets

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • ARQ 2.9.0
    • ARQ 2.9.1
    • ARQ
    • None
    • Windows 7 Enterprise 64 bit

    Description

      The SPARQL XML and JSON Result formats are very slow when the result set is large. This is surprising to me since both formats are relatively simple and should lend themselves to fairly fast streaming serialization and parsing.

      The following are observed performance figures comparing SPARQL XML, SPARQL JSON and SPARQL TSV results format. This is the averaged time over 5 runs to retrieve the first 50,000 triples from the dataset with a simple SELECT * WHERE

      { ?s ?p ?o } LIMIT 50000 via a HTTP request to Fuseki and iterate over the results on the client.

      SPARQL XML = 15.25 seconds
      SPARQL JSON = 10.9 seconds
      SPARQL TSV = 0.54 seconds

      Now obviously TSV is way simpler to serialize and parse than XML/JSON but these serializers and parsers should not be 20-30 times slower IMO

      Also for comparison note that doing an equivalent CONSTRUCT { ?s ?p ?p } WHERE { ?s ?p ?o }

      LIMIT 50000 takes only about 2s and that is using RDF/XML serialization which I would have expected to be slower because RDF/XML is more complex to generate than either SPARQL XML/JSON results. I haven't dived into the code in detail to investigate why this is slow yet but do the Jena team have any thoughts on this?

      Attachments

        1. XMLOutputStAX.java
          7 kB
          Stephen Allen
        2. XMLOutputSAX.java
          9 kB
          Stephen Allen
        3. TestArqSerializerPerformance.java
          5 kB
          Rob Vesse
        4. Jena178.patch
          4 kB
          Damian Steer
        5. Jena178.java
          6 kB
          Damian Steer

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            shellac Damian Steer
            rvesse Rob Vesse
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment