Skip to content

speedup possible by using in rather than re.search #1

@arkarkark

Description

@arkarkark

I got my runtime down to 3m25s from 4m2s by using these functions instead.

def this_line_is_useless(line):
    useless_es = [
        'BEGIN TRANSACTION',
        'COMMIT',
        'sqlite_sequence',
        'CREATE UNIQUE INDEX',
        'PRAGMA foreign_keys=OFF'
        ]
    for useless in useless_es:
        if useless in line:
                return True

def has_primary_key(line):
    return 'PRIMARY KEY' in line

https://stackoverflow.com/questions/4901523/whats-a-faster-operation-re-match-search-or-str-find

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions