You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Alex Parvulescu <al...@gmail.com> on 2013/06/05 14:32:21 UTC

NodeBuilder#setProperty using the same value

hi,

I'm wondering if we could turn the NodeBuilder#setProperty into a noop when
setting the same value on a property.

I'm doing that without even thinking about it in the lucene module, and I
suspect there are other bits that fallback to the same idea.

RIght now it looks like in some cases is increases the revision, and in
turn it will probably force the commit to run some diffs only to find that
the nodestates are in fact equal.

thoughts?

alex

Re: NodeBuilder#setProperty using the same value

Posted by Michael Dürig <md...@apache.org>.

On 5.6.13 13:43, Jukka Zitting wrote:
> Hi,
>
> On Wed, Jun 5, 2013 at 3:32 PM, Alex Parvulescu
> <al...@gmail.com> wrote:
>> I'm wondering if we could turn the NodeBuilder#setProperty into a noop when
>> setting the same value on a property.
>
> I don't see any bigger issues with this, though it would be nice to
> have a benchmark that verifies that the added complexity (though small
> in this case) is worth it.

Upfront equality check on all such calls might end up being more 
expensive then allowing a property to be set to its own value once in a 
while.

Michael

Re: NodeBuilder#setProperty using the same value

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Wed, Jun 5, 2013 at 3:32 PM, Alex Parvulescu
<al...@gmail.com> wrote:
> I'm wondering if we could turn the NodeBuilder#setProperty into a noop when
> setting the same value on a property.

I don't see any bigger issues with this, though it would be nice to
have a benchmark that verifies that the added complexity (though small
in this case) is worth it.

Note that such no-op changes are currently in any case filtered out
when producing the JSOP diff that's then passed to the underlying
MicroKernel. And the SegmentMK uses other means of detecting and
unifying duplicate content.

BR,

Jukka Zitting