spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JoshRosen <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-14972] Improve performance of JSON sche...
Date Sat, 30 Apr 2016 07:07:55 GMT
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/12750#issuecomment-215943176
  
    After a bit more time in a profiler, I was able to make this 2x faster than my previous
best time.
    
    To give a rough idea of the structure of my benchmark:
    
    I have a folder containing a bunch of gigantic JSON documents with huge, deeply-nested
schemas. Imagine the schema being the union of a huge number of smaller schemas, so it's pretty
big and sparse.
    
    My benchmark harness reads in the raw JSON, caches it, unions it together a bunch of times
to inflate the benchmark runtime (to avoid small constant factor noise), then coalesces it
to a single partition to avoid task-launch overheads (and so we measure single-core performance):
    
    ```scala
    val lines = spark.read.text("...").rdd
    lines.cache.count()
    val coalescedLines =  (lines ++ lines ++ lines ++ lines ++ lines).coalesce(1)
    
    for (i <- 1 to 10) {
      val startTime = System.currentTimeMillis
      spark.read.json(coalescedLines)
      println(s"Took ${System.currentTimeMillis - startTime}")
    }
    ```
    
    Before (f5da592fc63b8d3bc09d49c196d6c5d98cd2a013), this took around 88 seconds.
    
    After (6bf5ee634ee7e509a88e64236f18e3c6e7a07aa2), this takes about **14.5 seconds**.
    
    Coupled with the changes in #12741, a change that led to a massive speedup in the `reduce`
/ `treeAggregate` step, this should be a huge speedup vs 1.6.x.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message