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

Fix/usleep #568

Merged
merged 27 commits into from
May 25, 2018
Merged

Fix/usleep #568

merged 27 commits into from
May 25, 2018

Conversation

gjrtimmer
Copy link
Collaborator

sqlite3.go defines the following:

Line: 12

#cgo CFLAGS: -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DHAVE_USLEEP=1

This means usleep is activated even for Windows OS.

However usleep is a *nix command and not available on Windows.
When usleep is not available SQLite3 waits for 1 second.

This implementation adds the usleep command for Windows to increases performance.

Full fix review

BenchMark

Key Value
OS Windows 10 Build: 17134.48
CPU Intel: 2.8 GHz
Cores 4
Memory 16 GB

BenchMark before fix.

BenchmarkExec           100000      40339 req/s
BenchmarkQuery           10000       3932 req/s
BenchmarkParams           5000       3367 req/s
BenchmarkStmt             5000       4010 req/s
BenchmarkRows                1          1 req/s
BenchmarkStmtRows         1000        447 req/s

BenchMark after fix.

BenchmarkExec           100000      77720 req/s
BenchmarkQuery           10000       6751 req/s
BenchmarkParams          10000       6579 req/s
BenchmarkStmt            10000       6878 req/s
BenchmarkRows                1          1 req/s
BenchmarkStmtRows         1000        632 req/s

This PR is based upon #563 please merge #563 before merging this.

@mattn Please remove you stale branch add-usleep.

Renamed files containing current features.
Add: Feature Table
Add: Links
Add: TOC
Fix: References for TOC
* Keep current build tags backwards compliant
* Added alias for `sqlite_json1` => `sqlite_json`
Fix: New build tag(s) names
Add documentation to feature table for tag `trace`
Usage of new build tag names
Added Cross-Compile jobs for additional feature(s)
Required for building SQLite module `icu`
Removed: 32Bit Windows Cross-Compile
Aggregated: sqlite_trace into main module build
Implement `usleep` for Windows OS.
@coveralls
Copy link

Coverage Status

Coverage decreased (-2.7%) to 65.326% when pulling 7c89b38 on GJRTimmer:fix/usleep into 29ac65f on mattn:master.

@gjrtimmer
Copy link
Collaborator Author

Build successful; coverage failed probably because it was a decrease apparently because of the added file.

Can be merged after #563

@mattn mattn merged commit b8b158d into mattn:master May 25, 2018
@mattn
Copy link
Owner

mattn commented May 25, 2018

Thanks.

@gjrtimmer gjrtimmer deleted the fix/usleep branch May 26, 2018 19:05
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.

3 participants