Closed Galarzaa90 closed 5 years ago
Code Climate has analyzed commit 5e8093d4 and detected 25 issues on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Complexity | 25 |
Note: there are 2 critical issues.
View more on Code Climate.
Migrating a sqlite database was a really long task, taking up to half an hour to migrate the current database (14k chars, 377k level ups, 127k deaths)
A brief explanation of how I was doing things before and after:
Before
The rest of the migration process contains very few data compared to the rest and it probably won't be optimized... much
After
"Galarzaa Fidera" -> 1
copy_records_to_table
function, and does a bulk insert (this is the real performance gain)243 -> 231
character_death_killers
, we have an incrementing variable that assigns the death's id to the killer entry. This has no way to know if death ids didn't start at 1 or a death wasn't saved for some reason, potentially messing all data.copy_records_to_table
to bulk insert deathscopy_records_to_table
to bulk insert death killerscopy_records_to_table
to bulk insert level ups.The new changes, can reduce the time from 5,400 seconds to as little as 20 seconds.