Closed chopraanmol1 closed 6 years ago
@tgturner Some changes in this PR are very low-level optimization but since they are in the critical path they do make difference. If you have a better approach for those optimizations let me know.
Also don't just merge yet I'll like to test Excelx::Cell::DateTime#create_datetime a bit more to ensure that it does not break on some edge case
I'll give this a look over today!
@tgturner I've rebased with master as most recent commit had a conflict
@tgturner I've added relevant test case for timezone offset change overlap bug. On master this test case will fail for ENV['TZ'] = "Asia/Calcutta". New implementation of Excelx::Cell::DateTime#create_datetime handles this edge case properly. I think we can go ahead with this now.
LGTM!
Although not much difference for retained memory, this PR focuses on reducing allocated object/memory. Some of the changes are really a low-level optimization but they helped in reducing memory usage.
The script used for benchmarking
Results for master:
Results after changes:
This PR improves both memory usage and CPU performance by around 60%. But this result will majorly vary based on xlsx file used for benchmarking (Thus my result may be biased).
I'll suggest creating a common big xlsx file which contains all supported data types and re-benchmark on that file.