-
Notifications
You must be signed in to change notification settings - Fork 10
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
Improve performance #4
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
benchmark old ns/op new ns/op delta BenchmarkVimLParser_VimLParser-4 522557385 384606362 -26.40%
1 similar comment
before: . . 140:func viml_split(s string, sep string) []string { . . 141: if sep == `\zs` { . . 142: var ss []string . . 143: for _, r := range s { 58.05MB 58.05MB 144: ss = append(ss, string(r)) . . 145: } . . 146: return ss . . 147: } . . 148: panic("NotImplemented viml_split") . . 149:} after: . . 140:func viml_split(s string, sep string) []string { . . 141: if sep == `\zs` { 21.02MB 21.02MB 142: ss := make([]string, 0, len(s)) . . 143: for _, r := range s { 4MB 4MB 144: ss = append(ss, string(r)) . . 145: } . . 146: return ss . . 147: } . . 148: panic("NotImplemented viml_split") . . 149:}
…erface{}{lnum, col} benchmark old ns/op new ns/op delta BenchmarkVimLParser_VimLParser-4 366894571 295205749 -19.54%
benchmark old ns/op new ns/op delta BenchmarkVimLParser_VimLParser-4 295205749 262219875 -11.17%
benchmark old ns/op new ns/op delta BenchmarkVimLParser_VimLParser-4 262219875 248887206 -5.08%
benchmark old ns/op new ns/op delta BenchmarkVimLParser_VimLParser-4 248887206 235228838 -5.49%
|
1 similar comment
1 similar comment
Benchmarks$ pwd
/home/haya14busa/src/github.com/ynkdir/vim-vimlparser
$ git rev-parse HEAD
2fff43c58968a18bc01bc8304df68bde01af04d9
$ wc -l < autoload/vimlparser.vim
5195
$ time vim -u NONE -N --cmd "let &rtp .= ',' . getcwd()" --cmd "silent call vimlparser#test('autoload/vimlparser.vim')" -c ":q"
vim -u NONE -N --cmd "let &rtp .= ',' . getcwd()" --cmd -c ":q" 48.88s user 0.05s system 99% cpu 48.942 total
$ python3 -V
Python 3.5.0
$ time python3 py/vimlparser.py autoload/vimlparser.vim > /dev/null
python3 py/vimlparser.py autoload/vimlparser.vim > /dev/null 4.17s user 0.04s system 99% cpu 4.236 total
$ pypy3 -V
Python 3.2.5 (b2091e973da69152b3f928bfaabd5d2347e6df46, Mar 04 2016, 07:08:30)
[PyPy 2.4.0 with GCC 5.3.0]
$ time pypy3 py/vimlparser.py autoload/vimlparser.vim > /dev/null
pypy3 py/vimlparser.py autoload/vimlparser.vim > /dev/null 2.63s user 0.06s system 99% cpu 2.694 total
$ node --version
v4.2.3
$ time node js/vimlparser.js autoload/vimlparser.vim > /dev/null
node js/vimlparser.js autoload/vimlparser.vim > /dev/null 0.77s user 0.04s system 125% cpu 0.644 total
$ go get github.com/haya14busa/go-vimlparser/cmd/vimlparser
$ time vimlparser autoload/vimlparser.vim > /dev/null
vimlparser autoload/vimlparser.vim > /dev/null 0.36s user 0.02s system 125% cpu 0.299 total
Something Extra$ pwd
/home/haya14busa/src/github.com/haya14busa/go-vimlparser
$ git rev-parse HEAD
db7e1558c2c9a2a85b8b61bbfd2550f348b5677e
$ time go run cmd/vimlparser/main.go ../../ynkdir/vim-vimlparser/autoload/vimlparser.vim > /dev/null
go run cmd/vimlparser/main.go > /dev/null 0.54s user 0.08s system 124% cpu 0.491 total Go is the fastest even with compile time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.