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

Build optimizations? #21

Open
chakrit opened this issue Jul 31, 2015 · 2 comments
Open

Build optimizations? #21

chakrit opened this issue Jul 31, 2015 · 2 comments

Comments

@chakrit
Copy link

chakrit commented Jul 31, 2015

Of all the dependencies in my project, sql-migrate is the slowest to build on a clean run. I think this was because of the references to all the database drivers included.

Is there a way to speed this up?

@rubenv
Copy link
Owner

rubenv commented Jul 31, 2015

What helps a lot is running go install github.com/mattn/go-sqlite3. Same thing probably applies for the other database engines.

This doesn't help you for a clean compile (it's all the cgo stuff in there that makes it slow), but avoids it for subsequent compiles.

@lmas
Copy link

lmas commented Jan 2, 2021

How about injecting the db engines with sub packages, the way it's done with init(), sql pkg and all it's available drivers?
That way you don't have to worry about heavy pkgs like sqlite.

Example:

import (
        "github.com/rubenv/sql-migrate"
        _ "github.com/rubenv/sql-migrate/sqlite3"
        _ "github.com/mattn/go-sqlite3"
)

Had a quick look and it seemed it's only config.go and migrate.go that imports all engines in the same place, so it feels pretty easy to split them up?

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

3 participants