--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/a082bd55-9608-4657-8b25-0fed4d19da7f%40googlegroups.com.
@Bartholomew — one thing you can do to minimize code loading time is to require modules inside functions instead of outside. For instance:
exports.myExpensiveFunc = functions.https.onRequest((req, res) => {
const expensiveModule = require('expensive-module');
expensiveModule(req.body).then(result => res.send(result));
});
This will only incur the parse/load time for the specific function when it’s run.
Hello Hriar, Peter, and Bartholomew,Thanks for this. I wanted to ack this conversation and let you know that we have talked about it internally. Functions is a huge initiative involving a lot of internal resources, so it's a big discussion to see how we can coordinate more frequent updates, but we hear you loud and clear.We're looking at at least an update on what's happening right now, if not a more cyclic report.☼, Kato
On Mon, Mar 26, 2018 at 4:00 PM, Bartholomew Furrow <fur...@gmail.com> wrote:
I'm glad you sent this; I just made an exhaustingly-researched post[0] about this being a problem for using CF to distribute computations.As an aside, one of the challenges of cold starts is that with the way functions are uploaded through Firebase, all your functions use the same modules. So if you have just one function that uses, say, cloud storage, then every function's cold starts become just a little bit slower.Cheers,Bartholomew[0] Note that the research was exhausting, not exhaustive.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/a082bd55-9608-4657-8b25-0fed4d19da7f%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CADypTEZkcoJDob63g5DCoZC5mkL%2Be8xFUCzk6hUzSVEtWSNsPQ%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/yddyVVMbbgo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/44f4b486-298b-4313-aa52-bd8707c90958%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAHaiWHNqBnjhcque5mAnFE4wSV2_WAdb6QTXLox4F-4oaUWvsQ%40mail.gmail.com.
require() caches, so it can safely be called over and over for the same module
On Fri, Mar 30, 2018, 7:18 PM Bartholomew Furrow <fur...@gmail.com> wrote:
Kato, Michael and Jason: As always, I appreciate the responsiveness of the Firebase team!I'm glad to hear that there are efforts underway for Jason's #1 and #2.Vis-a-vis Michael's suggestion, I don't know enough about nodejs to know this: if I require() in a function, will that be cached across multiple calls to that function, or does the work of requiring get done every time the function is called? It would be nice if JS simply had a "lazy" keyword like Swift.I can pile on a little to the discussion of cold start times: I chopped a whole second off the cold-start time of every one of my functions by removing just two calls to gcs.bucket(bucketName). Here's a pattern people can use if they'd like.[0]One last question. Can someone take a look at this thread and comment on the sorts of super-slow starts I'm seeing when I try to send a lot of requests to a cold https function at once? The thing I'm looking at specifically is how the last shard can start more than 15 seconds after it was requested.Thanks again!Bartholomew[0] Here's how I took my call to gcs.bucket(stagingBucketName); out of the top-level:const stagingBucket = (() => {var instance = null;return {getInstance: () => {if (instance === null) {instance = gcs.bucket(stagingBucketName);}return instance;}};})();Then:stagingBucket.getInstance().file(filePath).download({destination: downloadPath})
To unsubscribe from this group and all its topics, send an email to firebase-talk+unsubscribe@googlegroups.com.
--
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/44f4b486-298b-4313-aa52-bd8707c90958%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAHaiWHNqBnjhcque5mAnFE4wSV2_WAdb6QTXLox4F-4oaUWvsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CANPY8KXgwTorALz7u1E-afbOhuNQioJgXdeYJUyRx%3DyJ-x-dEA%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/44f4b486-298b-4313-aa52-bd8707c90958%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAHaiWHNqBnjhcque5mAnFE4wSV2_WAdb6QTXLox4F-4oaUWvsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CANPY8KXgwTorALz7u1E-afbOhuNQioJgXdeYJUyRx%3DyJ-x-dEA%40mail.gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/yddyVVMbbgo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CABvc%3DwvObZX%2BjVWxTGeKYSjm6JQqmPNPn7a0ESx1338Ryp%2BGWQ%40mail.gmail.com.