question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

About performance

See original GitHub issue

METEOR@1.6.1.1 cultofcoders:grapher@1.3.6

i’ve tested my db and got performance issue.

GroupMembers.addLinks({
  group: {
    type: 'one',
    collection: Groups,
    field: 'groupId',
  },
  user: {
    type: 'one',
    collection: Users,
    field: 'userId',
  },
})

const groupmembers = GroupMembers.createQuery({
  user: {
    username: 1,
  },
  group: {
    name: 1,
  },
}).fetch()

I20180625-10:04:58.430(8)? … 6583 more items ] I20180625-10:04:58.430(8)? undefined: 1285.079ms

this is another test by fetch all content and assemble manually

const users = Users.find().fetch()
const groups = Groups.find().fetch()

const usersKeyById = _.keyBy(users, '_id')
const groupsKeyById = _.keyBy(groups, '_id')

const groupmembers = GroupMembers.find().map(gm => ({
  user: usersKeyById[gm.userId],
  groups: groupsKeyById[gm.groupId],
  ...gm,
}))

I20180625-10:05:58.910(8)? … 6583 more items ] I20180625-10:05:58.910(8)? undefined: 285.375ms

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
theodorDiaconucommented, Jul 9, 2018

@crapthings this has been fixed in 1.3.7. You will do it faster if you do it manually just because you don’t apply filters and the database returns your responses much faster, so it’s not necessarily a Grapher disadvantage. Anyway, I tested for the following:

1000 users 1000 groups Each user has 2 groups, so 2 group memberships per user ~2000

Results using your way: 58ms Results using Grapher: 70ms

This is acceptable if we take into account that it retrieves only the Users and Groups that you need. (In our case all bc the use-case is built that way, but you get it!)

1reaction
crapthingscommented, Jun 25, 2018

it looks like query was transform into mongo aggregate

https://github.com/cult-of-coders/grapher/issues/188#issuecomment-359643600

Read more comments on GitHub >

github_iconTop Results From Across the Web

see whether tabs or extensions are slowing down Firefox
Firefox's Task Manager feature shows you performance information, such as what tabs or add-ons are making Firefox slow.
Read more >
Performance - Wikipedia
A performance is an act of staging or presenting a play, concert, or other form of entertainment. It is also defined as the...
Read more >
The Future of Performance Reviews - Harvard Business Review
Hated by bosses and subordinates alike, traditional performance appraisals have been abandoned by more than a third of U.S. companies.
Read more >
What is a Performance Review [Definition] - Quantum Workplace
A performance review is a two-way, individualized conversation between a manager and an employee about performance impact, development, and ...
Read more >
Performance Management: Definition, How It Works, and ...
Performance management is a corporate management tool that helps managers to monitor and evaluate employees' work.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found