Giter Club home page Giter Club logo

Comments (3)

faultyserver avatar faultyserver commented on June 12, 2024

Nice catch. Just looking quickly, I think this could be resolved by simple changing the *_time members of gtfs::stop_time into resolved DateTimes.

The comparisons in the query functions are converting them into DateTimes anyway, so I don't see much of a performance hit. In fact, this could actually be a massive storage improvement (12 bytes per DateTime vs 17 bytes per string representation; 400k stop times would mean megabytes of RAM being saved, plus the indices could be optimized).

from timetable_cpp.

elliottwilliams avatar elliottwilliams commented on June 12, 2024

The issue is that stop times don't actually have associated dates, they're based on the calendar date a trip is active.

from timetable_cpp.

faultyserver avatar faultyserver commented on June 12, 2024

Right. Clearly I've been away from this for too long.

A naive solution (sans maybe trans-atlantic aquatic transit support) could be to start the date iteration 2-3 days before the given start date.

A less naive solution might iterate the stop times within the bounds of the query on the index and determine how far back the date needs to go.

I can't think of a better way that wouldn't at least double memory or run time.

from timetable_cpp.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.