githubbob42 / mingle2github2

0 stars 1 forks source link

Optimize Get By Id on iOS #3758

Open githubbob42 opened 8 years ago

githubbob42 commented 8 years ago

Mingle Card: 4082 Justification

Currently iOS take 1000+ ms on our simulators to retrieve a record by Id.  It is probably worse on the actual hardware.  It can make iPads seem sluggish especially in the case of rule engine.

Rather than rewriting the whole db layer for accessing data, we could make this one change to enhance performance.  This should enhance performance with a very small effort and measurable outcome.

Acceptance Criteria

A noticeable improvement in general behavior on iPads.  This should be measurable with a set of benchmarks on the simulator and on Chrome using WebSql.

Analysis

https://github.com/dpitre/alpine-mobile/tree/perf_test   Could be wrong but it seems like the shim makes things better for us.  I got horrible times with this branch.  Maybe i missed something….

Timings in chrome loading the quote page:

  1. getById FX5__Quote__c 25
  2. GetById FX5__Status__c a0Ni000001e7ih1EAA : 12.474ms
  3. GetById FX5__Status__c a0Ni000001e7ih1EAA : 14.379ms
  4. GetById FX5__Status__c a0Ni000001e7ih1EAA : 67.676ms
  5. GetById Account 001i000000NCCeeAAH : 71.559ms
  6. GetById Account 001i000000NCCPqAAP : 76.701ms
  7. getById User 135
  8. getById RecordType 124
  9. getById User 110
  10. getById User 52

Timings in iOS simulator loading the quote page:

  1. getById FX5__Quote__c 17
  2. GetById FX5__Status__c a0Ni000001e7ih1EAA : 72 ms
  3. GetById Account 001i000000NCCeeAAH : 96 ms
  4. GetById Account 001i000000NCCPqAAP : 170 ms
  5. getById User 134
  6. getById RecordType 124
  7. getById User 105
  8. getById User 99

Timings in Chrome loading a job page:

  1. jobs J-123-ABCD : 8.685ms
  2. FX5__Status__c a0Ni00000028xk0EAA : 42.881ms
  3. FX5__Status__c a0Ni00000028xk0EAA : 19.830ms
  4. jobs J-123-ABCD : 50.315ms
  5. FX5__Well__c a0Wi000000AGI8VEAX : 8.298ms

Timings in Chrome loading the quote list:

  1. GetById Account 001i000000NCCeeAAH  160 ms
  2. GetById Account 001i000000NCCRHAA5  166 ms
  3. GetById Account 001i000000NCCi6AAH  176 ms
  4. GetById Account 001i000000NCCRHAA5  183 ms
  5. GetById Account 001i000000NCCi6AAH  193 ms
  6. GetById Account 001i000000NCCRHAA5  200 ms
  7. GetById Account 001i000000NCCi6AAH  212 ms
  8. GetById Account 001i000000NCCRHAA5  219 ms
  9. GetById Account 001i000000NCCi6AAH  226 ms
  10. GetById Account 001i000000NCCRHAA5  235 ms
  11. GetById Account 001i000000NCCi6AAH  244 ms
  12. GetById Account 001i000000NCCRHAA5  252 ms
  13. GetById Account 001i000000NCCd4AAH  261 ms
  14. GetById Account 001i000000NCCPsAAP  267 ms
  15. GetById Account 001i000000NCCi6AAH  310 ms
  16. GetById Account 001i000000NCCRHAA5  317 ms
  17. GetById Account 001i000000NCCi6AAH  326 ms
  18. GetById FX5__Status__c a0Ni000001e7ih1EAA  300 ms
  19. GetById FX5__Status__c a0Ni000001e7ih1EAA  306 ms
  20. GetById FX5__Status__c a0Ni000001e7ih1EAA  315 ms
  21. GetById FX5__Status__c a0Ni000001e7ih1EAA  320 ms
  22. GetById FX5__Status__c a0Ni000001e7ih1EAA  328 ms
  23. GetById FX5__Status__c a0Ni000001e7ih1EAA  333 ms
  24. GetById FX5__Status__c a0Ni000001e7ih1EAA  340 ms
  25. GetById FX5__Status__c a0Ni000001e7ih1EAA  347 ms
  26. GetById FX5__Status__c a0Ni000001e7ih1EAA  355 ms
  27. GetById FX5__Status__c a0Ni000001e7ih1EAA  363 ms
  28. GetById FX5__Status__c a0Ni000001e7ih1EAA  369 ms
  29. GetById FX5__Status__c a0Ni000001e7ih1EAA  378 ms
  30. GetById FX5__Status__c a0Ni000001e7ih1EAA  383 ms
  31. GetById FX5__Status__c a0Ni000001e7ih1EAA  391 ms
  32. GetById FX5__Status__c a0Ni000001e7ih1EAA  396 ms
  33. GetById FX5__Status__c a0Ni000001e7ih1EAA  404 ms
  34. GetById FX5__Status__c a0Ni000001e7ih1EAA  412 ms
  35. GetById FX5__Status__c a0Ni000001e7ih1EAA  418 ms
  36. GetById FX5__Status__c a0Ni000001e7ih1EAA  426 ms
  37. GetById FX5__Status__c a0Ni000001e7ih1EAA  430 ms

Timings in iOS loading the quote list:

  1. GetById FX5__Status__c a0Ni000001e7ih1EAA  220 ms
  2. GetById FX5__Status__c a0Ni000001e7ih1EAA  424 ms
  3. GetById FX5__Status__c a0Ni000001e7ih1EAA  473 ms
  4. GetById FX5__Status__c a0Ni000001e7ih1EAA  459 ms
  5. GetById FX5__Status__c a0Ni000001e7ih1EAA  380 ms
  6. GetById FX5__Status__c a0Ni000001e7ih1EAA  350 ms
  7. GetById FX5__Status__c a0Ni000001e7ih1EAA  301 ms
  8. GetById FX5__Status__c a0Ni000001e7ih1EAA  328 ms
  9. GetById FX5__Status__c a0Ni000001e7ih1EAA  367 ms
  10. GetById FX5__Status__c a0Ni000001e7ih1EAA  382 ms
  11. GetById Account 001i000000NCCQPAA5  651 ms
  12. GetById FX5__Status__c a0Ni000001e7ih1EAA  418 ms
  13. GetById FX5__Status__c a0Ni000001e7ih1EAA  411 ms
  14. GetById Account 001i000000NCCPqAAP  889 ms
  15. GetById FX5__Status__c a0Ni000001e7ih1EAA  408 ms
  16. GetById Account 001i000000NCCeeAAH  1012 ms
  17. GetById FX5__Status__c a0Ni000001e7ih1EAA  342 ms
  18. GetById Account 001i000000NCCRHAA5  1074 ms
  19. GetById FX5__Status__c a0Ni000001e7ih1EAA  324 ms
  20. GetById Account 001i000000NCCi6AAH  1165 ms
  21. GetById FX5__Status__c a0Ni000001e7ih1EAA  268 ms
  22. GetById Account 001i000000NCCRHAA5  1204 ms
  23. GetById FX5__Status__c a0Ni000001e7ih1EAA  289 ms
  24. GetById Account 001i000000NCCRHAA5  1268 ms
  25. GetById FX5__Status__c a0Ni000001e7ih1EAA  247 ms
  26. GetById Account 001i000000NCCi6AAH  1301 ms
  27. GetById FX5__Status__c a0Ni000001e7ih1EAA  176 ms
  28. GetById Account 001i000000NCCi6AAH  1268 ms
  29. GetById FX5__Status__c a0Ni000001e7ih1EAA  128 ms
  30. GetById Account 001i000000NCCRHAA5  1254 ms
  31. GetById Account 001i000000NCCi6AAH  1267 ms
  32. GetById Account 001i000000NCCRHAA5  1050 ms
  33. GetById Account 001i000000NCCi6AAH  1057 ms
  34. GetById Account 001i000000NCCRHAA5  675 ms
  35. GetById Account 001i000000NCCd4AAH  580 ms
  36. GetById Account 001i000000NCCPsAAP  486 ms
  37. GetById Account 001i000000NCCi6AAH  495 ms
  38. GetById Account 001i000000NCCRHAA5  312 ms
  39. GetById Account 001i000000NCCi6AAH  320 ms

Related Stories

Tasks

{{table query: SELECT Number, Name, Owner, 'Task Status' WHERE Type = Task and Story = THIS CARD}}

Defects

{{ table query: SELECT Number, Name, Owner, 'Status' WHERE Type = Defect and 'Related Story' = THIS CARD }}

Test Plan

githubbob42 commented 8 years ago

Pull Request #1831