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

add Batch method to Rater #5

Merged
merged 1 commit into from
Jan 11, 2016
Merged

Conversation

dukex
Copy link
Contributor

@dukex dukex commented Jan 1, 2016

Happy new year!!!

This commits introduces follow features:

  • EnableAutoUpdateSimilarsAndSuggestions and DisableAutoUpdateSimilarsAndSuggestions method to engine, using this
    methods the user can manager the engine auto update similars and
    suggestions status.
  • Update method to engine, now users can update the similars and
    suggestions to a user manually.
  • Batch method to rater, now users can rater things in batch,
    maybe this commit resolve part of the Improve engine #1

In addition to the new API the batch operations is faster than normal
operations, follow a Benchmark

$ go test -bench .
PASS
BenchmarkNoBatch              20          53301558 ns/op
BenchmarkUsingBatch        10000            187824 ns/op

@dukex
Copy link
Contributor Author

dukex commented Jan 1, 2016

The previous benchmark is wrong 😞 I found a bug in my first implementation, follow the correct benchmark:

$ go test -bench . 
PASS
BenchmarkNoBatch              20          68577540 ns/op
BenchmarkUsingBatchWithoutAutoUpdate         300           5860922 ns/op
BenchmarkUsingBatchWithAutoUpdate            100          19714002 ns/op
ok      github.com/hjr265/too   6.890s

Happy new year!!!

This commits introduces follow features:

* `EnableAutoUpdate` and `DisableAutoUpdate` method to engine, with this
methods the user can manager the engine auto update similars and
suggestions status.

* `Update` method to engine, now users can update the similars and
suggestions to a user manually.

* `Batch` method to rater, now users can rater things in batch,
maybe this commit resolve part of the FurqanSoftware#1

In addition to the new API the batch operations is faster than normal
operations, follow a Benchmark

``` bash
$ go test -bench .
PASS
BenchmarkNoBatch              20          53301558 ns/op
BenchmarkUsingBatch        10000            187824 ns/op
```
@hjr265
Copy link
Member

hjr265 commented Jan 6, 2016

@dukex This is a really cool pull request! Thanks.. I will take a look at it and merge it asap 😄

hjr265 added a commit that referenced this pull request Jan 11, 2016
add Batch method to Rater
@hjr265 hjr265 merged commit 0be5828 into FurqanSoftware:master Jan 11, 2016
@dukex dukex deleted the add-batch branch January 11, 2016 16:14
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.

2 participants