哪些更快?还是没有区别?哪一个更有效率,在绝对路径上运行还是在ref +相对路径上运行?
选项1个
const rootRef = new Firebase(process.env.FIREBASE_URL)
const absolutePath1 = '/foo/bar/hello'
const absolutePath2 = '/foo/bar/yoda'
rootRef.child(absolutePath1).update(...)
rootRef.child(absolutePath2).update(...)
选项2
// ref points to '/foo/bar'
ref.child('hello').update(...)
ref.child('yoda').update(...)
通过互联网传输字节的速度将大大超过串联字符串的任何处理速度。因此,不会有显着的差异。另外,这两个内部没有什么不同 - 只有两个字符串可以分开/连接。 – Kato
@Kato,昨天穆罕默德回答了这个问题。 –
@Kato,昨天穆罕默德回答了这个问题。 –