ember.js 2.使用嵌套模板更多地消耗了RAM



我想知道是否使用嵌套模板它非常 RAM消耗 ...

类似的东西:

Router.map(function() {
  this.route('index', {path: '/'});
  this.route('login');
  this.route('authors', {path: 'authors'}, function() {
    this.route('author', {path: ':author_id'}, function() {
      this.route('book', {path: ':book_id'}, function() {
        this.route('cart', {path: 'cart'});
      });
    });
  });
});

比这更多的ram重

Router.map(function() {
  this.route('index', {path: '/'});
  this.route('login');
  this.route('authors', {path: '/authors'});
  this.route('author', {path: '/author/:author_id'});
  this.route('book', {path: '/book/:book_id'});
  this.route('cart', {path: '/cart/:cart_id'});
});

两个路由图将消耗大致相同的内存。您的应用程序中可能还有很多其他内容比路由层要消耗的内存更多。通常,您不应该根据潜在内存消耗来决定使用哪种路由布局,而应基于UI和URL的外观。

最新更新