dieswaytoofast / erlasticsearch

Erlang thrift interface to elastic_search
45 stars 18 forks source link

why erlasticsearch_poolboy_worker launch an erlasticsearch module #11

Open benoitc opened 10 years ago

benoitc commented 10 years ago

I am wondering why you are launching another process inside the poolboy worker which will forward to it all the calls. Why not having everything handled in the poolboy worker and functions that checking/checkout it before passing to it a call?

dieswaytoofast commented 10 years ago

Strictly for dereferencing purposes. I/we use this module across a number of different places, and its easier to just standardize it as this (for me). If/when performance becomes a real issue, it would be useful to avoid that one additional function call. But, that said, the roundtrip overhead of hitting ElasticSearch is so much greater than this, that it hasn't been worth it thus far...

benoitc commented 10 years ago

fair enough. More than the performance, I was thinking that the memory usage, since you are passing the messages twice. But indeed that's a premature optimisation :)