Comments (11)
I think I found the fix for this, in the file model.js there is a line at the top that reads:
var gcloud = require('google-cloud');
While I have a limited understanding of Node at this point, my assumption is this sucks in all libraries inside Google Cloud which is quite large and seems to take a long time to get through, if I change that line to:
var gcloud = require('google-cloud/datastore');
it seems to skip everything except the datastore which is all we need I think? I've done basic testing and this seems to work fairly well.
I did not have NPM v3 so this may account for a lot of this as well, but if it's true that we only need the datastore component from the google-cloud library I think this could be a useful update.
from gstore-node.
Try changing out your gcloud
dependency with google-cloud
first. gstore relies on the latter. This may fix your problem because your google dependency may be cached for gstore to use.
Does that solve your problem?
from gstore-node.
Nope, it looks like even swapping it google-cloud makes it slow by itself. Just to give some more information I am starting the server with this command:
/usr/local/bin/node --debug-brk=55023 --expose_debug_as=v8debug
And just doing this creates the issue:
var gcloud = require('google-cloud')(configGcloud);
My configGcloud looks like this:
{
"projectId": "myproject",
"credentials": {
"client_email": "xxxxxdeveloper.gserviceaccount.com",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQI.....
}
}
Could this be causing my issue? Thanks for the help!
from gstore-node.
May I ask which npm and node version you are using? NPM 3 automatically
flattens dependencies google-cloud has an absolute ton. This should help it
load what it needs to with less looking around.
Also have you tried just running it line by line through the Node REPL?
Just to be sure that that specific line is taking so long and not debugger
attachment or anything external.
On Sep 26, 2016 1:49 PM, "Shaun" [email protected] wrote:
Nope, it looks like even swapping it google-cloud makes it slow by itself.
Just to give some more information I am starting the server with this
command:/usr/local/bin/node --debug-brk=55023 --expose_debug_as=v8debug
And just doing this creates the issue:
var gcloud = require('google-cloud')(configGcloud);
My configGcloud looks like this:
{
"projectId": "myproject",
"credentials": {
"client_email": "xxxxxdeveloper.gserviceaccount.com",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQI.....
}
}Could this be causing my issue? Thanks for the help!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#16 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGOnw0OdqIgcGIV4qw8Z2cgQ5j-uOi78ks5quAWOgaJpZM4KGHu8
.
from gstore-node.
Nice catch. Although I highly recommend upgrading NPM anyways! :-)
@sebelga can you verify this?
from gstore-node.
Looks like we also need to change the references to gcloud.datastore to maybe just datastore, for example on line 287 we have:
if (info.moreResults !== gcloud.datastore.NO_MORE_RESULTS) {
but this needs to be changed to:
if (info.moreResults !== gcloud.NO_MORE_RESULTS) {
since gcloud is now the datastore or perhaps the variable should be renamed to datastore wholesale to avoid confusion.
from gstore-node.
Hi,
I will have a look into this, and yes I will make the change to only require the datastore library and not the whole package :)
@micaww thanks for looking into this. and @shaunc869 thanks for reporting!
from gstore-node.
Hi, just updated the library with the dependency now only on "@google-cloud/datastore". Could you check if this solves your loading problem? thanks!
from gstore-node.
It does solve the slow loading issue, thanks for that!
On Mon, Oct 3, 2016 at 11:23 AM, Sébastien Loix [email protected]
wrote:
Hi, just updated the library with the dependency now only on
"@google-cloud/datastore". Could you check if this solves your loading
problem? thanks!—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#16 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFyjMsUdO0u308-VOzjou3wehIdk32y3ks5qwUgEgaJpZM4KGHu8
.
from gstore-node.
Happy to hear that! :)
from gstore-node.
I had the same issue in the past, changed the reference and gone fine. If I remember, I think it was the google logging require.
from gstore-node.
Related Issues (20)
- query filter on nested property value. HOT 5
- tsc error: Could not find a declaration file for module 'nsql-cache' HOT 3
- could not get data filter by entity key
- Support for @google-cloud/datastore version 5 HOT 2
- Support for custom validators (AJV)
- bulk insert? HOT 2
- Cannot read property 'Symbol(KEY)' when body is null or undefined HOT 1
- Typescript Compile Error HOT 2
- Support for HABTM
- Could not find gstore instance with id "${id}" HOT 2
- How to validate a value agains another property? HOT 1
- Datastore Key type error when using cache HOT 7
- Update method doesn't clear cache HOT 6
- Add Transaction support to `findOne` option HOT 1
- Support filtering for a missing optional property. HOT 1
- New query operators HOT 1
- @google-cloud/datastore version 7 support HOT 1
- could not get data filter by entity key HOT 1
- Migrate Travis CI builds to Circle CI
- Gstore node 7.2.8 TypeError: OptionalDataloader is not a constructor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gstore-node.