Skip to content

Reorganise structs layout to improve mem padding #437

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

Merged
merged 2 commits into from
Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions cmd/gitbase/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ const (

// Server represents the `server` command of gitbase cli tool.
type Server struct {
Verbose bool `short:"v" description:"Activates the verbose mode"`
engine *sqle.Engine
pool *gitbase.RepositoryPool
name string

Version string // Version of the application.
Directories []string `short:"d" long:"directories" description:"Path where the git repositories are located (standard and siva), multiple directories can be defined. Accepts globs."`
Depth int `long:"depth" default:"1000" description:"load repositories looking at less than <depth> nested subdirectories."`
DisableGit bool `long:"no-git" description:"disable the load of git standard repositories."`
DisableSiva bool `long:"no-siva" description:"disable the load of siva files."`
Host string `long:"host" default:"localhost" description:"Host where the server is going to listen"`
Port int `short:"p" long:"port" default:"3306" description:"Port where the server is going to listen"`
User string `short:"u" long:"user" default:"root" description:"User name used for connection"`
Expand All @@ -49,14 +51,11 @@ type Server struct {
DisableSquash bool `long:"no-squash" description:"Disables the table squashing."`
TraceEnabled bool `long:"trace" env:"GITBASE_TRACE" description:"Enables jaeger tracing"`
ReadOnly bool `short:"r" long:"readonly" description:"Only allow read queries. This disables creating and deleting indexes as well." env:"GITBASE_READONLY"`
// SkipGitErrors disables failing when Git errors are found.
SkipGitErrors bool
// Version of the application.
Version string

engine *sqle.Engine
pool *gitbase.RepositoryPool
name string
SkipGitErrors bool // SkipGitErrors disables failing when Git errors are found.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is changing the output of gitbase server --help command? If yes, could you change it on the documentation too please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ajnavarro - done

DisableGit bool `long:"no-git" description:"disable the load of git standard repositories."`
DisableSiva bool `long:"no-siva" description:"disable the load of siva files."`
Verbose bool `short:"v" description:"Activates the verbose mode"`
}

type jaegerLogrus struct {
Expand Down
6 changes: 3 additions & 3 deletions docs/using-gitbase/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,8 @@ Help Options:
-h, --help Show this help message

[server command options]
-v Activates the verbose mode
-d, --directories= Path where the git repositories are located (standard and siva), multiple directories can be defined. Accepts globs.
--depth= load repositories looking at less than <depth> nested subdirectories. (default: 1000)
--no-git disable the load of git standard repositories.
--no-siva disable the load of siva files.
--host= Host where the server is going to listen (default: localhost)
-p, --port= Port where the server is going to listen (default: 3306)
-u, --user= User name used for connection (default: root)
Expand All @@ -79,5 +76,8 @@ Help Options:
--no-squash Disables the table squashing.
--trace Enables jaeger tracing [$GITBASE_TRACE]
-r, --readonly Only allow read queries. This disables creating and deleting indexes as well. [$GITBASE_READONLY]
--no-git disable the load of git standard repositories.
--no-siva disable the load of siva files.
-v Activates the verbose mode

```
8 changes: 4 additions & 4 deletions squash_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ type ReposIter interface {
type squashReposIter struct {
ctx *sql.Context
filters sql.Expression
done bool
iter *RepositoryIter
repo *Repository
row sql.Row
skipGitErrors bool
done bool
}

// NewAllReposIter returns an iterator that will return all repositories
Expand Down Expand Up @@ -410,12 +410,12 @@ type squashRefIter struct {
ctx *sql.Context
repo *Repository
repos *RepositoryIter
virtual bool
filters sql.Expression
refs storer.ReferenceIter
head *plumbing.Reference
ref *Ref
row sql.Row
virtual bool
skipGitErrors bool
}

Expand Down Expand Up @@ -3131,11 +3131,11 @@ type squashCommitFilesIter struct {
commits CommitsIter
files *object.FileIter
file *object.File
treeHash plumbing.Hash
commit *object.Commit
row sql.Row
filters sql.Expression
ctx *sql.Context
treeHash plumbing.Hash
skipGitErrors bool
}

Expand Down Expand Up @@ -3260,10 +3260,10 @@ type squashIndexCommitFilesIter struct {
repo *Repository
iter *commitFilesIndexIter
file *object.File
treeHash plumbing.Hash
row sql.Row
filters sql.Expression
ctx *sql.Context
treeHash plumbing.Hash
skipGitErrors bool
}

Expand Down