diff options
| author | Geremia Taglialatela <[email protected]> | 2023-09-08 23:07:09 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-09-08 23:07:09 +0200 |
| commit | ba7d1757f02663ce9231e08e0ccb6b45155f9204 (patch) | |
| tree | 118a1c272106b51fae7599adf02abcafa7fcb670 /examples/basic_formula_example.md | |
| parent | 3866257ec99c646a82c6f12e52361fbc4efc9b38 (diff) | |
| download | caxlsx-ba7d1757f02663ce9231e08e0ccb6b45155f9204.tar.gz caxlsx-ba7d1757f02663ce9231e08e0ccb6b45155f9204.zip | |
Use `class.name` instead of `class.to_s`
`class.name` is faster, uses less memory than `class.to_s`, and can
be used in this context.
This micro optimization does not have practical effect, it is just a
reference for the future in case this approach will be needed in
other parts of the library
```
Comparison (IPS):
Object.name: 13528803.0 i/s
Object.to_s: 8213612.0 i/s - 1.65x (± 0.00) slower
Comparison (Memory):
Object.name: 0 allocated
Object.to_s: 40 allocated - Infx more
```
Diffstat (limited to 'examples/basic_formula_example.md')
0 files changed, 0 insertions, 0 deletions
