hamishforbes / lua-resty-iputils

Utility functions for working with IP addresses in Openresty
MIT License
246 stars 84 forks source link

lua-resty-iputils vs lua-libcidr-ffi performance #19

Open louishot opened 4 years ago

louishot commented 4 years ago

Which one is better?

hamishforbes commented 4 years ago

Maybe you could run some benchmarks and let us all know?

louishot commented 4 years ago

Maybe you could run some benchmarks and let us all know?

ya I can try it If No existing benchmark data

louishot commented 4 years ago

Maybe you could run some benchmarks and let us all know? https://github.com/hamishforbes/lua-resty-iputils/issues/4 I see "When I benchmarked the pure Lua implementations against libcidr-ffi, libcidr-ffi was quite a bit faster, particularly for IPv6 (sorry I don't have any numbers handy anymore). But I'll put a big caveat around this, since I was just hacking around with copying and pasting those existing Lua implementations and trying to make them work--I'm not sure if what I managed to implement was very optimized. A more optimized pure Lua approach might be possible. And while the performance difference in micro-benchmarks was noticeable, I'm not sure if it would really have that much of a real world impact."