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

Create temporary tables to improve performance #5

Merged
merged 1 commit into from
Sep 1, 2023
Merged

Conversation

fzakaria
Copy link
Owner

@fzakaria fzakaria commented Sep 1, 2023

Create temporary tables for symbols and instructions to improve performance.

There is an upfront cost to ingesting the data into a temporary table but it's relatively nominal (2s) and every query is WAY faster afterwards.

Also moved pyright to a poetry dependency.

TY for help and advice from @rogerbinns

Create temporary tables for symbols and instructions to improve
performance.

There is an upfront cost to ingesting the data into a temporary table
but it's relatively nominal (2s) and every query is WAY faster
afterwards.

Also moved pyright to a poetry dependency.
@@ -63,4 +63,10 @@ def register(connection: apsw.Connection, binaries: list[lief.Binary]):
generator.columns, generator.column_access = apsw.ext.get_column_names(
next(generator())
)
apsw.ext.make_virtual_module(connection, "elf_instructions", generator)
apsw.ext.make_virtual_module(connection, "raw_elf_instructions", generator)
connection.execute(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: maybe make this a flag to control whether a user wants to pay the cost?
Might be worthwhile for tiny binaries.

@@ -6,6 +6,7 @@
import apsw
import apsw.ext
import lief
from ..elf.section import section_name as elf_section_name
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't understand how to import :(

@fzakaria fzakaria merged commit c0f9ebf into main Sep 1, 2023
1 check passed
@fzakaria fzakaria deleted the improve-speed branch September 1, 2023 17:43
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

Successfully merging this pull request may close these issues.

1 participant