angularjs - What is more efficient: single node or multi node loading with Firebase/AngularJS 1.x
问题描述
I have one page where I need to load multiple nodes from the Firebase Real-Time Database. The structure is as follows:
/overview/$date/list
/overview/$date/alerts
/overview/$date/other
What is more efficient when using AngularJS 1.x:
- load
overview/$date
once - or creating multiple functions and loading per node:
- load
/overview/$date/list
- load
/overview/$date/alerts
- load
/overview/$date/other
- load
解决方案
Assuming that $date only contains those same three children, and you want all the children all the time, you will probably not measure much of a difference between the two. The single query may be a tad faster. But if you have other children under it that you don't want to read, the single query might be slower, as it's loading more data than you need.
推荐阅读
- c++ - 将 int 转换为 int* 会发生什么?
- java - 用于 ElasticSearch 多字段搜索的 Java API
- graphql - 如何使用 Prisma 和 GraphQL 创建自解析对象类型数组
- azure-cosmosdb - 使用 azure-documentdb-java 的 Azure Cosmos DB 分页
- android - Xamarin UI Test Click the 3 dots to expand menu and select menu item
- java - Dynamic filtering for objects arraylist java
- amazon-web-services - Aws sdk for .NET custom region endpoint configuration
- c# - 构造多部分 MIME 消息而不将其保存在内存中
- data-visualization - Combining separate temporal measurement series
- java - How do I use reflection to access a private method?