ElectronicObserverEN / ElectronicObserver

Electronic Observer is a game viewer for Kantai Collection.
Other
81 stars 19 forks source link

Csv export performance improvement #454

Closed myangelkamikaze closed 6 months ago

myangelkamikaze commented 6 months ago

Admiral level fetching is kinda hacky right now. I wonder if it might be better to just grab all the relevant port files from the first sortie to the last one, and then just take the first and last values, and do a binary search if those are different. The slow part is db access, so getting all at once shouldn't be problematic?

Short explanation: There are multiple data exports, but they all work exactly the same.

image

The first ShellingBattle is a wrapper that's meant to make it simpler to use from the outside, so you basically just do DataExportHelper.ShellingBattle(...). I was thinking of removing this wrapper, but I think it's better to have it.

The second ShellingBattle is basically just a mapper from SortieDetailViewModel to ShellingBattleExportModel. The export models then get converted to CSV.

image

The ProcessData function... The first parameter is a function with the signature that the second ShellingBattle has. This is needed so that those functions only need to do the actual data processing without worrying about loading data, incrementing the progress counters etc.

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
5.3% Duplication on New Code

See analysis details on SonarCloud