Metrics for performance claim

Hi there! I noticed in the README that it says:

All in all, RNFirebase provides much faster performance (~2x) over the web SDK.

I’m really curious to see the metrics you gathered for this! It seems like something that would be quite difficult to measure.

Author: Fantashit

1 thought on “Metrics for performance claim

  1. @brentvatne good point, you’re right this is something that is and has proven quite difficult to measure.

    We initially got these numbers when we first started building our testing suite app.

    One of the features of the tests app is the ability to switch the tests between using the official web sdk or the RNFirebase implementation for comparative testing. Running the tests using the RNFirebase implementation vs using the Web SDK was almost 2-3x faster in terms of completion time (each test is timed and its run time is displayed upon completion).

    Admittedly though that this is more of a real world scenario vs a raw benchmark, the app makes use of redux and react navigation libraries both of which are JS based and compete with the web sdk on the JS thread.

    In terms of a raw benchmark – in an empty app that renders null the results are quite different:
    moo
    As you can see they’re pretty much on par with each other, the only exception being that the web sdk seems to lazy connect on the first ref request hence the 1.6s on the first iteration. The query used is a orderByChild query with startAt and endAt query modifiers, see code below.

      setInterval(() => {
        const now = performance.now();
        return firebase.database()
          .ref('matches')
          .orderByChild('date_unix')
          .startAt(1493942400)
          .endAt(1494028799)
          .once('value', (snapshot) => {
            console.log(performance.now() - now);
          });
      }, 2000);

    I would like to expand on the documentation in terms of performance, do you have any recommended approaches for benchmarking in react native – especially JS vs Native? I’m a bit of a performance junkie myself so would be interested in a more effective approach.

Comments are closed.

Metrics for performance claim

Hi there! I noticed in the README that it says:

All in all, RNFirebase provides much faster performance (~2x) over the web SDK.

I’m really curious to see the metrics you gathered for this! It seems like something that would be quite difficult to measure.

Author: Fantashit

1 thought on “Metrics for performance claim

  1. @brentvatne good point, you’re right this is something that is and has proven quite difficult to measure.

    We initially got these numbers when we first started building our testing suite app.

    One of the features of the tests app is the ability to switch the tests between using the official web sdk or the RNFirebase implementation for comparative testing. Running the tests using the RNFirebase implementation vs using the Web SDK was almost 2-3x faster in terms of completion time (each test is timed and its run time is displayed upon completion).

    Admittedly though that this is more of a real world scenario vs a raw benchmark, the app makes use of redux and react navigation libraries both of which are JS based and compete with the web sdk on the JS thread.

    In terms of a raw benchmark – in an empty app that renders null the results are quite different:
    moo
    As you can see they’re pretty much on par with each other, the only exception being that the web sdk seems to lazy connect on the first ref request hence the 1.6s on the first iteration. The query used is a orderByChild query with startAt and endAt query modifiers, see code below.

      setInterval(() => {
        const now = performance.now();
        return firebase.database()
          .ref('matches')
          .orderByChild('date_unix')
          .startAt(1493942400)
          .endAt(1494028799)
          .once('value', (snapshot) => {
            console.log(performance.now() - now);
          });
      }, 2000);

    I would like to expand on the documentation in terms of performance, do you have any recommended approaches for benchmarking in react native – especially JS vs Native? I’m a bit of a performance junkie myself so would be interested in a more effective approach.

Comments are closed.