You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and noticed that queries to the database were painfully slow specifically in WSL, but not in Windows Node (both versions of node are the same: 8.9) or in a native Ubuntu Node environment
Steps:
initialize the app for your own server:
const admin = require('firebase-admin');
var serviceAccount = require("path/to/serviceAccountKey.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount)
});
var db = admin.firestore();
this requires installing firebase-admin to communicate with a firestore database.
then run a very simple example query:
var docRef = db.collection('users').doc('alovelace');
var setAda = docRef.set({
first: 'Ada',
last: 'Lovelace',
born: 1815
});
this takes around 20 seconds in my WSL environment. In Windows node and native Ubuntu node it is instantaneous. Executing the same query in the web browser version of the tutorial, as opposed to the node version, in WSL runs instantaneously. Maybe this slowness might be due to the apparent dependency on grpc by firebase-admin-node? I can't find any WSL issues mentioning grpc, but would there be any reason grpc would run much slower in WSL than elsewhere?
The text was updated successfully, but these errors were encountered:
Yes, I ditched WSL2 for powershell. After running firebase serve in WSL it takes multiple seconds just to send a request back and forth. File downloads/uploads take even longer. I wouldn't advice running the emulators in WSL.
If you are switching from WSL to native windows there is not much to worry about. Just install everything (nodejs for windows, firebase-cli npm package, google sdk for windows) remove functions/node_modules folders in project you worked on and npm install again. You should see 10x increase in speed.
@nicobrinkkemper was your project stored in your Windows drive? WSL2 has faster file system performance than WSL 1 as long as you are running inside of your Linux root file system. Check our docs page for more info.
@dontsave in general this seems related to file system performance in WSL1, which we're tracking on issue #873. WSL2 is aimed at fixing this issue.
[win ver 10.0.16299.19 running Ubuntu Xenial installed from the windows store]
I was following this quick getting started tutorial with Firebase/Firestore for Node JS:
https://firebase.google.com/docs/firestore/quickstart?authuser=0
and noticed that queries to the database were painfully slow specifically in WSL, but not in Windows Node (both versions of node are the same: 8.9) or in a native Ubuntu Node environment
Steps:
initialize the app for your own server:
this requires installing firebase-admin to communicate with a firestore database.
then run a very simple example query:
this takes around 20 seconds in my WSL environment. In Windows node and native Ubuntu node it is instantaneous. Executing the same query in the web browser version of the tutorial, as opposed to the node version, in WSL runs instantaneously. Maybe this slowness might be due to the apparent dependency on grpc by firebase-admin-node? I can't find any WSL issues mentioning grpc, but would there be any reason grpc would run much slower in WSL than elsewhere?
The text was updated successfully, but these errors were encountered: