Getting high latency(>500ms) while reading/writing data to cloud fire store

My firestore collection has <100 documents, I am using firestore-go-SDK to establish connection. Below is the code
which I am using to query firestore.

    func connectFirestore() {
    	ctx := context.Background()
    
    	// Sets your Google Cloud Platform project ID.
    	projectID := <Project-ID>
    
    	client, err := firestore.NewClient(ctx, projectID)
    	if err != nil {
    		log.Println("Failed to create client: " + err.Error())
    	}
    	defer client.Close()
    
    	startTime := time.Now()
    	iter := client.Collection("User").Documents(ctx)
    	for {
    		_, err := iter.Next()
    		if err == iterator.Done {
    			break
    		} else if err != nil {
                log.Println("Error in iterator ", err)
    			break
    		}
    	}
    	endTime := time.Now()
    	log.Println("Latency of DB call ", endTime.Sub(startTime))
    
    }

When I try to access the same collection using a nodejs application I get a latency of less than 10ms. Code for nodeJS:

async function firebaseGetData() {
    const db = new Firestore({
        projectId: <Project-ID>,
        keyFilename: <Project-Key-File>,
    });
    firebaseGetData(db)
    var startTime = Date.now()
    const snapshot = await db.collection('User').get();
    var startTime = Date.now()
    snapshot.forEach((doc) => {
        console.log(doc.id, '=>', doc.data());
        var endTime = Date.now()
        var latency = endTime - startTime
        console.log("Latency " + latency)
    });
}