damoiser / qr-bills

Ruby Gem to generate QR-Bills for Swiss payments
BSD 3-Clause "New" or "Revised" License
21 stars 15 forks source link

Remove RMagick dependency (and improve performance, yay! 🎉) #4

Closed alexanderadam closed 3 years ago

alexanderadam commented 3 years ago

Hi @damoiser,

this PR removes the need for RMagick. Apart from that it is also faster as the current implementation (still unbearable slow though 😢).

![Benchmark screenshot](https://user-images.githubusercontent.com/372620/113192410-00eccf00-925f-11eb-83f6-bd206f68d3e3.png)

As you can see the implementation becomes even faster if oily_png is used. This is an optional mixin for Chunky PNG. This means it will speed up the implementation of the current PR.

I would have added a hint to the README but the current implementation of oily_png is not compatible yet with the current implementation of Chunky PNG (I did the benchmark with this branch).

Thus this should/could be added later on.

This PR already is improving speed and removes an unnecessary dependency. So I guess this should be good for now. 😉

damoiser commented 3 years ago

hey @alexanderadam thanks for this performance improvement! let's think about switching to oily_png when the compatibility issues will be fixed

alexanderadam commented 3 years ago

let's think about switching to oily_png when the compatibility issues will be fixed

It doesn't need a switch (as mentioned in the comment above, oily_png is optional!). Every user can simly & require oily_png in a project and it will be faster automatically. Thus I would only document oily_png at a later point.