philvessey / NextDepartures

NextDepartures is a .NET Library that queries GTFS (General Transit Feed Specification) data sets stored locally or in an Azure SQL Database. The library will work with any well formed GTFS data set.
MIT License
1 stars 1 forks source link

Reduce loops #11

Closed philvessey closed 4 years ago

philvessey commented 5 years ago

Calculate the three days in one loop so that the timezone calculated and so on can be reused. This is likely to improve performance.

hypervtechnics commented 4 years ago

This will also save a lot of iterations when only wanting a specific count of results.

philvessey commented 4 years ago

Is this a big refactor job again?

hypervtechnics commented 4 years ago

No more kind of changing loop iterations and moving code and removing/adding parameters.

philvessey commented 4 years ago

OK great - I have got some benchmarks on how long each call takes now so I can compare.

hypervtechnics commented 4 years ago

Okay I will do the optimization during the next days...

hypervtechnics commented 4 years ago

I still have this planned and did not forget it. Very busy atm.

philvessey commented 4 years ago

Ok no problem :)

hypervtechnics commented 4 years ago

Okay, I looked into it. I'd leave it for now like it is. It's getting complicated as ByStop and ByTrip have different approaches of handling the limit. If I fully understood the logic I will do some more refactoring on the refactored part. Any thoughts @philvessey ?

philvessey commented 4 years ago

I'm happy to leave as it is - its already pretty fast at returning results depending on the size of the data set of course. I will close this one for now - can always be reopened if we have a change of heart.