cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Checking spark performance locally

mghildiy
New Contributor

I am experimenting with spark, on my local machine. So, is there some tool/api available to check the performance of the code I write?

For eg. I write:

val startTime = System.nanoTime()
  invoicesDF
    .select(
      count("*").as("Total Number Of Invoices"),
      sum("Quantity").as("Total Quantity"),
      avg("UnitPrice").as("Avg Unit Price"),
      countDistinct("InvoiceNo").as("Number Of Unique Invoices")
    )
    .show()
 
  println((System.nanoTime() - startTime) / 1000000000.0)

I am using System.nanoTime to do these calculations, but am not sure of this is correct way.

Btw, this takes time of around 2.7 seconds, using 3 threads, and file having 541900 records. Is it a good performance? It is a 16GB, 4 core, 2.40GHz Intel processor.

1 REPLY 1

Hubert-Dudek
Esteemed Contributor III

Please check the details about your code (task in jobs) in Spark UI.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group