README.md in takes_macro-1.0.0 vs README.md in takes_macro-1.0.1
- old
+ new
@@ -1,7 +1,10 @@
# TakesMacro
+![ci badge](https://github.com/tonsser/takes_macro/workflows/Ruby/badge.svg "ci badge")
+
+
[attr_extras][] is a **great** gem that lets you remove most of the boilerplate needed for creating different types of initializers in Ruby.
This gem contains a reimplementation of `pattr_initialize` from attr_extras that is much faster. If you're using attr_extras, but the only feature of it you're using is `pattr_initialize` then this gem is for you.
This gem calls the method `takes` to avoid confusing, but the API is exactly the same.
@@ -21,12 +24,14 @@
takes_macro 1.209M (± 4.5%) i/s - 6.045M in 5.011814s
hand written initializer
875.721k (± 5.8%) i/s - 4.424M in 5.071249s
Comparison:
- takes_macro: 1208748.5 i/s
- hand written initializer: 875721.1 i/s - 1.38x slower
- attr_extras: 169352.8 i/s - 7.14x slower
+ takes_macro: 1208748.5 i/s
+ hand written initializer: 875721.1 i/s - 1.38x slower
+ attr_extras: 169352.8 i/s - 7.14x slower
+
+The initializer generated by `takes` is faster than the hand written version because the `takes` version uses an options hash, and the hand written version uses keyword arguments, which are a bit slower. You can see the exact code for the benchmark [here](https://github.com/tonsser/takes_macro/blob/master/benchmarks/takes_macro_vs_attr_extras.rb).
## How it works
This gem expands this