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

Switch to pure lua messagepack implementation #10

Open
Orfen-0 opened this issue Mar 24, 2021 · 4 comments
Open

Switch to pure lua messagepack implementation #10

Orfen-0 opened this issue Mar 24, 2021 · 4 comments

Comments

@Orfen-0
Copy link

Orfen-0 commented Mar 24, 2021

Hello, would it be possible to remove the C dependency on the messagepack implementation and use a pure lua implementation such as https://fperrad.frama.io/lua-MessagePack? This would allow this library to work with ioredis-mock which uses Fengari and potentially other Lua vms.

Thank you

@luin
Copy link
Member

luin commented Mar 24, 2021

Hi @Orfen-0, it's indeed a good plus if there's a way to make this library work well with ioredis-mock. However, I'm afraid performance-wise there's a gap between the current C implementation vs the pure Lua one given Redis doesn't support LuaJIT. We don't want to sacrifice performance for ease of testing.

Are there any related performance benchmarks we can refer to?

@Orfen-0
Copy link
Author

Orfen-0 commented Mar 24, 2021

Hi @luin, thank you for the response. I haven't been able to make it work myself for our needs yet, and as such I have no performance metrics to share. Unfortunately I have limited experience in Lua so I'm having issues with switching cmsgpack to the lua message pack. However if you think that is something worth investigating, if you could give me some pointers on how I would go about doing this it would be greatly appreciated.

Thank you

@luin
Copy link
Member

luin commented Mar 24, 2021

Unfortunately I have limited experience in Lua.

Me neither 🤣 Especially when it comes to bridges between C & Lua & Node.js so I'm afraid I can't provide much helps for this. However, as an alternative, I think a way to go would be mocking ioredis-tree in your unit tests.

@Orfen-0
Copy link
Author

Orfen-0 commented Mar 24, 2021

No worries, understandable, thank you for taking the time to answer my question :)

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

No branches or pull requests

2 participants