Git Product home page Git Product logo

Comments (10)

kwalrath avatar kwalrath commented on June 9, 2024

@naomiblack I've noticed this too.

from angulardart.org.

chalin avatar chalin commented on June 9, 2024

Seems to be related to the Backend App. IMHO, for now, a simple fix would be to limit the number of entries in the DB to some small number (say 50 or 100).

from angulardart.org.

chalin avatar chalin commented on June 9, 2024

Or tweak the demo app to fetch only the last 50 or 100 entries.

from angulardart.org.

mraleph avatar mraleph commented on June 9, 2024

AngularFire is loading data in a very inefficient manner: it listens to child_added event and adds children one by one to the collection. This causes n^2 behavior when loading initial state because on each added children we redigest, detect a new child and update ng-repeat. n is rather large which causes 10s pause. (There are other n^2 things in there but redigesting and updating ng-repeat over and over again is the biggest offender).

Instead of doing this AngularFire should seed initial state of the collection using value event and ignore child_added when child is already present.

I hacked it together out of curiosity and while it does not remove pause altogether it does reduce it considerably. I can send a pull request against AngularFire.

/cc @mhevery

from angulardart.org.

anantn avatar anantn commented on June 9, 2024

@mraleph Do send in your pull request if you already have one to https://github.com/firebase/angularFire. An easy way to avoid redigesting on the initial value load is doing the following:

var initialLoaded = false;
ref.on('child_added', function(snapshot) {
  if (!initialLoaded) return;
  // otherwise, add to collection
});
ref.once('value', function(snapshot) {
  initialLoaded = true;
  // set collection to snapshot.val();
});

from angulardart.org.

steve-taylor avatar steve-taylor commented on June 9, 2024

Hope to see a fix work its way to the AngularDart demo page soon. It gives the impression that AngularDart and even Dart is not ready for evaluation let alone production.

from angulardart.org.

therealmarv avatar therealmarv commented on June 9, 2024

Actually this issue on the demo page was the main reason for me not to look any further on AngularDart. If the main AngularDart devs do not get their simple demo good running why should I invest time in learning something which is not ready yet and only looks good at first glance. Currently I'm more looking into Angular.JS.

from angulardart.org.

naomiblack avatar naomiblack commented on June 9, 2024

We've temporarily fixed the issue by clearing the entries in Firebase. Will get a more substantive fix in soon, but the team's focus right now is on getting 1.0 launched. Please let me know if it's still molasses slow to load.

from angulardart.org.

kwalrath avatar kwalrath commented on June 9, 2024

It's much faster for me now. Do we need to periodically clear the Firebase entries until we really fix this?

from angulardart.org.

katowulf avatar katowulf commented on June 9, 2024

FirebaseExtended/angularfire#304 should help with this. The 0.8 release batches elements and only runs one compile per batch. The wait time can be adjusted for maximum efficiency.

from angulardart.org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.