snoww / loa-logs

LOA Logs - Modern DPS Meter for Lost Ark
GNU General Public License v3.0
132 stars 32 forks source link

Optimize parse_line function with iterator and improved error handling #1

Closed FernanCa12 closed 1 year ago

FernanCa12 commented 1 year ago

Note: Just a few change, hope they will help with something

snoww commented 1 year ago

I like the changes a lot, however my shitty parser code later access the slices by index, and this change breaks the parsing at the moment Maybe we change all to using an iterator instead of slice?

https://github.com/snoww/loa-logs/blob/e2a2a2a5a649982cbd2a2373ca537ed40de68aa7/src-tauri/src/parser/mod.rs#L149-L150 https://github.com/snoww/loa-logs/blob/e2a2a2a5a649982cbd2a2373ca537ed40de68aa7/src-tauri/src/parser/mod.rs#L194-L196 https://github.com/snoww/loa-logs/blob/e2a2a2a5a649982cbd2a2373ca537ed40de68aa7/src-tauri/src/parser/mod.rs#L518-L546

FernanCa12 commented 1 year ago

I tested using an Iterator instead of a Slice to see if it would improve performance. While there was some improvement, it was not significant enough to justify continuing with the Iterator approach. Additionally, since the data processing is relatively simple in most cases, the potential performance gain from using iterators over a vector slice is minimal.

I will proceed to close the pull request.