Perlbal with remove field option #10

Merged
merged 4 commits into from Feb 1, 2012

Conversation

Projects
None yet
3 participants

atoomic commented Nov 23, 2011

Here is the PR of the feature that could disable on demande for production server the field::new
thanks for your review
nicolas

atoomic commented Nov 23, 2011

Code has been cleaned using perltidy and comments added to an easier integration

Owner

dormando commented Nov 29, 2011

Huh, thanks for cleaning it up. Any chance you could rebase that all down so it's just the changesets and not the original set + all of the stuff in the middle?

I don't seem to get e-mail notifications when pull requests are updated, so feel free to e-mail me or the list when you have updates in here :/

atoomic added some commits Nov 29, 2011

@atoomic atoomic improve bool version, using a static method a8ad641
@atoomic atoomic Perlbal::Fields provide a simple way to override field::new that uses…
… Hash::Util::lock_ref_keys

set env PERLBAL_REMOVE_FIELDS=1 to unactivate fields stuff
fields are fast for reading access, but slow when need to create many objects
c3203e5
@atoomic atoomic provide some tests 148254b
@atoomic atoomic manifest and changes update 503cb1f

atoomic commented Nov 29, 2011

rebase done

@hachi hachi merged commit 503cb1f into perlbal:master Feb 1, 2012

Owner

hachi commented Feb 1, 2012

Thank you sir for your effort on this.

I personally can't fathom needing to optimize the SET for bool values like you have, but it is faster... I'm going to assume you are using this for something good.

The fields item is nice to have, and I'm going to consider similar changes to Gearman::Server as well. If you have any further optimization ideas please keep things going.

Apologies for taking so long to merge this, thanks for your patience.

--hachi

atoomic commented Feb 1, 2012

Thanks for your update on the topic Jonathan.
You will find attached to this email a graph with the benchmark I made
using several objects models but also hashes, arrays and fields.
Yes fields are great, as they have for main goal to convert a hash
into an array at compilation.

But the main problem is that creating object using field has a huge cost !
in perlbal to answer to a single request, you need to create ~10 objects...
so during my stress bench on perlbal, I've noticed that this was not
an advantage to use fields...
but of course this will depend on the server load

There is not one object model better than the other... it all depends
on the ratio of object creation, updating / reading attributes....
your application does
to my mind moo is provide probably the best average for a standard
application, but of course it s not acceptable for a webserver...

Here is a short presentation on the topic :
http://public.iwork.com/document/?d=perl-object.key&a=p1350724493

nicolas

2012/1/31 Jonathan Steinert
reply@reply.github.com:

Thank you sir for your effort on this.

I personally can't fathom needing to optimize the SET for bool values like you have, but it is faster... I'm going to assume you are using this for something good.

The fields item is nice to have, and I'm going to consider similar changes to Gearman::Server as well. If you have any further optimization ideas please keep things going.

Apologies for taking so long to merge this, thanks for your patience.

--hachi


Reply to this email directly or view it on GitHub:
#10 (comment)

Owner

dormando commented Feb 1, 2012

I think jonathan was pointing out that you'd optimized some code which is only used during parsing of configuration lines (the bool stuff). I think it's fine to do that though.

atoomic commented Feb 1, 2012

Correct the bool stuff is only used for configuration, so it s not a
big improvement

2012/2/1 dormando
reply@reply.github.com:

I think jonathan was pointing out that you'd optimized some code which is only used during parsing of configuration lines (the bool stuff). I think it's fine to do that though.


Reply to this email directly or view it on GitHub:
#10 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment