Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance optimizations #149

Closed
jtomaszewski opened this issue Sep 27, 2016 · 8 comments
Closed

Performance optimizations #149

jtomaszewski opened this issue Sep 27, 2016 · 8 comments

Comments

@jtomaszewski
Copy link
Contributor

jtomaszewski commented Sep 27, 2016

Is the angular2-data-table optimized when it comes to performance?

I didn't get to see through all the code, but after a quick glimpse:

  • we could add a trackBy option to *ngFor="let row of rows; let i = index;" in Body component's template
  • components like BodyCell, BodyRow should propably be dependant only on Inputs and use ChangeDetectionStrategy.OnPush
  • components like Body propably could also use ChangeDetectionStrategy.OnPush, but as it's currently heavily dependant on StateService, we would need to add some rxjs observables to that or something.

What do you guys think? Maybe I could help a bit with that.

@amcdnl
Copy link
Contributor

amcdnl commented Sep 27, 2016

@jtomaszewski - Actually, I tried some of those ....

  1. trackBy gave me some odd errors when i tried it rc1, worth re-looking at for sure. You can track by the column id defined https://github.com/swimlane/angular2-data-table/blob/master/src/models/TableColumn.ts#L23.
  2. I had those changed, however, that caused errors with things not updating correctly. See this https://github.com/swimlane/angular2-data-table/commit/4c0658dff6b4cf6d9b040f5c3cc56b929911f27f#diff-6c5fe72c2cab8659bc1ddbfa686ed2f9.
  3. Absolutely. I've already got an issue open for https://github.com/swimlane/angular2-data-table/issues/32 support. I'd love to work with you on implementing that, my rx is not to the standard something like this requires.

@jtomaszewski
Copy link
Contributor Author

OK, I did most of it in my master branch. Can you check it out https://github.com/jtomaszewski/angular2-data-table , and either give me notes, what should I improve, or cherry-pick / merge all the commits ? (So I don't have to create a PR for each of them ;]).

@jtomaszewski
Copy link
Contributor Author

Hey, why did you close it? ;]

There's still some commits here that can be merged:

Should I do sepearte PRs for all of them?

@amcdnl amcdnl reopened this Sep 28, 2016
@amcdnl
Copy link
Contributor

amcdnl commented Sep 28, 2016

SorryI thought you said it was closed. I will manually merge them in :)

@amcdnl
Copy link
Contributor

amcdnl commented Sep 29, 2016

The do check has to stay but I did the rest :)

amcdnl added a commit that referenced this issue Sep 29, 2016
@jtomaszewski
Copy link
Contributor Author

Thanks for the quick merging ;)

Why does the doCheck has to stay? It's tempting to get rid of it as well.

@amcdnl
Copy link
Contributor

amcdnl commented Sep 29, 2016

Its for when the columns change externally ( i think lol ) and one other thing I forgot. I will dig it up though and add comments.

@amcdnl amcdnl self-assigned this Sep 29, 2016
@amcdnl
Copy link
Contributor

amcdnl commented Nov 15, 2016

Closing as no longer relevant due to total onpush refactor.

@amcdnl amcdnl closed this as completed Nov 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants