jolicode/ffi-uuid

Clarify intented use

bdsl opened this issue · 3 comments

bdsl commented

This looks like a nice library, but from the readme it isn't clear to me exactly what it's for. Specifically what advantages does this have over ramsey/uuid?

Might be worth adding something to the readme to clarify. Is it purely to serve as demonstration of FFI? Does it have performance advantages? Is this just to give us an extra option?

Hello. I wrote an article yesterday about that. But unfortunately, it's only in French for now. I'm sorry about that.

Anyway ramsey/uuid is an extra layer on top of the PECL (or random_bytes, or big number, it depends of what is available). So ramsey/uuid is out of context here. But at some point this package could be used by ramsey/uuid. And the PECL relies on libuuid.

This lib replace the PECL by binding PHP directly to libuuid via FFI. But it's slower than the PECL 😬

So basically, for now it's more a POC to demonstrate the power of FFI. But if the FFI implementation (in PHP Core) becomes faster, then it could be better at some point to use this package instead of the PECL

bdsl commented

Sounds good, thanks for clarifying - looking forward to using this in prod in a year or two when/if FFI is fast then. I can make a PR to add that to the readme if you like.

Oh, that would be very nice. Thanks you