blueprinter
blueprinter copied to clipboard
Improve .render performance
I used ruby-prof to analyze the time spent in methods and memoized the most expensive ones. There is a space tradeoff but it may be worth the time gains.
Master Prepared Object Ruby prof call tree Fork Prepared Object Ruby prof call tree
Master ActiveRecord Ruby prof call tree Fork ActiveRecord Ruby prof call tree
IPS
| IPS (object) | IPS (ActiveRecord) | |
|---|---|---|
| master | 11776.2 | 10003.1 |
| fork | 12880.6 | 10821.8 |
| diff | + 9.378% | + 8.184% |
Memory
| Memory allocated (object) | Memory allocated (ActiveRecord) | |
|---|---|---|
| master | 53278996 bytes (712340 objects) | 44599596 bytes (594605 objects) |
| fork | 51929108 bytes (694292 objects) | 48724236 bytes (649595 objects) |
| diff | - 2.534% | + 9.248 % |