MathNya / umya-spreadsheet

A pure rust library for reading and writing spreadsheet files
MIT License
240 stars 41 forks source link

improve reading speed #74

Open cstkingkey opened 2 years ago

cstkingkey commented 2 years ago

run cargo flamegraph --test integration_test -- read_large_string the result show that (1) umya_spreadsheet::helper::coordinate::index_from_coordinate and (2) umya_spreadsheet::structs::cells::Cells::set_fast are the main time consumers.

(1) is related to regex and format. (2) hashbrown::raw::RawTable<T,A>::reserve_rehash is the main time consumer. set the capacity of the HashMap properly can improve the speed. If there is a way to read the total cells in the worksheet in advance, it will be the best.

MathNya commented 2 years ago

Thank you for your report. I will check the areas you mentioned.