Skip to content

Commit

Permalink
docs: update version and benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Jh123x committed Sep 14, 2024
1 parent 1d94d57 commit 70c76e1
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ BuilderGen is a tool used for generating builders for Golang `structs`.

## Features
- [x] Generate builder files from `structs`
- [ ] Config paths to generate all structs
- [x] Config paths to generate all structs
- [ ] Generate builders with local imports in a different package

## QuickStart

Expand Down
17 changes: 9 additions & 8 deletions docs/benchmarks/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ For commits that do not write to disk, we will be writing a disk writer file to

The old code only contains CodeGen + I/O mode as I/O is tightly coupled to the implementation.

| Version | Runtime of CodeGen + I/O | Runtime of CodeGen only | Changes |
| Version | Runtime of CodeGen + I/O | Runtime of CodeGen only | Changes |
| ------------ | ------------------------ | ----------------------- | --------------------------------------- |
| v0.0.1 | 1083661 ns/op | - | Initial Version |
| v0.0.2 | 536149 ns/op | - | Format Builder in memory |
| v0.0.1 | 1083661 ns/op | - | Initial Version |
| v0.0.2 | 536149 ns/op | - | Format Builder in memory |
| v0.0.2 (alt) | 823289 ns/op | - | Use templates instead of string builder |
| v0.0.3 | 483838 ns/op | 267546 ns/op | Optimize keyword check |
| v0.0.3 (alt) | 603091 ns/op | 267859 ns/op | Optimize keyword differently |
| v0.0.4 | 293983 ns/op | 51133 ns/op | Manual format/import pkgs |
| v0.0.5 | 418557 ns/op | 202906 ns/op | Fix import part using parser |
| v0.0.3 | 483838 ns/op | 267546 ns/op | Optimize keyword check |
| v0.0.3 (alt) | 603091 ns/op | 267859 ns/op | Optimize keyword differently |
| v0.0.4 | 293983 ns/op | 51133 ns/op | Manual format/import pkgs |
| v0.0.5 | 418557 ns/op | 202906 ns/op | Fix import part using parser |
| v0.0.6 | 283447 ns/op | 45850 ns/op | Update import part using parser |
| v0.0.7 | 195134 ns/op | 48860 ns/op | Optimize string opts |
| v0.1.0 | 273165 ns/op | 28255 ns/op | Custom Parser |
| v0.1.0 | 273165 ns/op | 28255 ns/op | Custom Parser |
| v0.2.0 | 282231 ns/op | 30701 ns/op | Parsing by file + fix errors |
19 changes: 9 additions & 10 deletions docs/usage/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,15 @@ The config file should look something like this

```yaml
configs:
- source: source_file.go
destination: source_file_builder.go # Optional
package: pkg # Optional
name: StructName
with-validation: false # Optional
- source: source_file_2.go
destination: source_file_2_builder.go # Optional
package: pkg # Optional
name: StructName
with-validation: false # Optional
- source: ./internal/cmd/ttypes.go
name: Config
- source: ./internal/cmd/ttypes_test.go
name: testCase
destination: ./internal/cmd/ttypes_builder_test.go
- source: ./examples/benchmark/benchmark.go
name: Data
- source: ./examples/person.go
name: Person
```
This use case is more suitable for those who wants to build a builder for structs in other libraries but want to store
Expand Down
2 changes: 1 addition & 1 deletion examples/benchmark/benchmark_builder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/person_builder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/cmd/ttypes_builder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/cmd/ttypes_builder_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/consts/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package consts

const (
PARAM_NAME = "BuilderGen"
VERSION = "v0.0.7"
VERSION = "v0.2.0"

DEFAULT_BUILDER_SUFFIX = "_builder.go"

Expand Down

0 comments on commit 70c76e1

Please sign in to comment.