catdad / grandma

👵 fully programmable stress testing framework
20 stars 4 forks source link

look into using napajs for threads #168

Closed catdad closed 4 years ago

catdad commented 6 years ago

Using a fork is kinda expensive, and introduces extra complexity and overhead. Do a prototype with NapaJS to see if it is any better.

This might address issues with passing too many messages around, as well as possibly address issues #58 and #80.

catdad commented 6 years ago

So... Napa is it's own runtime, which means it does not have full support for all Node functionality. There is a node zone that should have full node functionality, but it is unclear to me how to use it. It seems this zone just exists, and I do not create it... and I have no idea how many workers this zone has. Does that even matter? Does it just scale infinitely?

It looks like executing a function in a zone/worker does not maintain context. This is fine (it sorta works that way already in grandma threads), but I still have questions about what is maintained and when. There are some bugs (like the require cache bug) that suggest there is some state saved in every worker. This sounds similar to what grandma already does. I need to investigate/confirm.

Looks like Napa has weird support for executing code. It would ideally be nice to support running grandma with code instead of a file, but it looks like Napa may not provide the API that a user would expect. This is okay, since grandma can currently only run with a file. It seems reasonable to use the existing fork worker (or rather, a similar file) that loads the user's grandma test file, and run Napa zone executes with the fork file.

catdad commented 4 years ago

Closing this in favor of using node's workers when dropping support for older versions of node.