Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory optimization? #85

Open
FabienD74 opened this issue Jun 10, 2024 · 0 comments
Open

Memory optimization? #85

FabienD74 opened this issue Jun 10, 2024 · 0 comments

Comments

@FabienD74
Copy link

Hi,
In the code of loader.py we have

    gtfs_tables = {}
    for gtfs_class in gtfs_all:
...
            gtfs_tables[gtfs_class] = fd.read_table(gtfs_filename,
                                                    set(c.name for c in gtfs_class.__table__.columns) - {'feed_id'})

then a few lines later:

    for gtfs_class in gtfs_all:
        if gtfs_class not in gtfs_tables:
            continue
        gtfs_table = gtfs_tables[gtfs_class]

To me (correct me if i'm wrong) :

  1. The whole unzipped content is loaded in memory in the first piece of code!!!... That's HUGE.... it should be avoided
  2. on the second piece of code, the last statement duplicate the table content of the current "gtfs_class" ( stops, stop_times, shapes ...) WHY ????? Can't we use gtfs_tables[gtfs_slass] directly ? Whithout duplicating the content into table "gtfs_table" ?

Thx

Regards
Fabien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant