You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dyre Tjeldvoll (JIRA)" <ji...@apache.org> on 2006/11/07 14:16:50 UTC
[jira] Created: (DERBY-2050) Manipulating CachedItems could be more
efficient
Manipulating CachedItems could be more efficient
---------------------------------------------------
Key: DERBY-2050
URL: http://issues.apache.org/jira/browse/DERBY-2050
Project: Derby
Issue Type: Improvement
Components: Performance
Affects Versions: 10.2.1.6
Reporter: Dyre Tjeldvoll
Priority: Trivial
Fix For: 10.3.0.0
CachedItem's state is currently recorded in bit fields of an integer variable. Changing this to 6 boolean member variables reduces cpu usage.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-2050) Manipulating CachedItems could be
more efficient
Posted by "Dyre Tjeldvoll (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-2050?page=comments#action_12447963 ]
Dyre Tjeldvoll commented on DERBY-2050:
---------------------------------------
[[ Old comment, sent from unregistered email on Tue, 07 Nov 2006 16:46:58 +0100 ]]
2 bytes more per CachedItem. If that is REALLY critical, why wasn't
the the six bit fields coded as a byte (rather than an int)?
--
dt
> Manipulating CachedItems could be more efficient
> ------------------------------------------------
>
> Key: DERBY-2050
> URL: http://issues.apache.org/jira/browse/DERBY-2050
> Project: Derby
> Issue Type: Improvement
> Components: Performance
> Affects Versions: 10.2.1.6
> Reporter: Dyre Tjeldvoll
> Priority: Trivial
> Fix For: 10.3.0.0
>
>
> CachedItem's state is currently recorded in bit fields of an integer variable. Changing this to 6 boolean member variables reduces cpu usage.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (DERBY-2050) Manipulating CachedItems could be
more efficient
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-2050?page=all ]
Knut Anders Hatlen resolved DERBY-2050.
---------------------------------------
Resolution: Fixed
Assignee: Dyre Tjeldvoll
Thanks Dyre. Derbyall and the JUnit tests ran cleanly (except a couple of known issues). Committed revision 472803.
> Manipulating CachedItems could be more efficient
> ------------------------------------------------
>
> Key: DERBY-2050
> URL: http://issues.apache.org/jira/browse/DERBY-2050
> Project: Derby
> Issue Type: Improvement
> Components: Performance
> Affects Versions: 10.2.1.6
> Reporter: Dyre Tjeldvoll
> Assigned To: Dyre Tjeldvoll
> Priority: Trivial
> Fix For: 10.3.0.0
>
> Attachments: derby-2050.diff, derby-2050.stat, derby-2050.v2.diff
>
>
> CachedItem's state is currently recorded in bit fields of an integer variable. Changing this to 6 boolean member variables reduces cpu usage.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (DERBY-2050) Manipulating CachedItems could be more
efficient
Posted by "Dyre Tjeldvoll (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-2050?page=all ]
Dyre Tjeldvoll updated DERBY-2050:
----------------------------------
Attachment: derby-2050.diff
derby-2050.stat
Seems like this change was possibly more controversial than I thought, but I'm attaching a patch anyway. Maybe those who are interested can look at the patch. Personally I found it very enlightening to compare the bytecode (using javap) generated for bitfield access with that generated for access to booleans .
> Manipulating CachedItems could be more efficient
> ------------------------------------------------
>
> Key: DERBY-2050
> URL: http://issues.apache.org/jira/browse/DERBY-2050
> Project: Derby
> Issue Type: Improvement
> Components: Performance
> Affects Versions: 10.2.1.6
> Reporter: Dyre Tjeldvoll
> Priority: Trivial
> Fix For: 10.3.0.0
>
> Attachments: derby-2050.diff, derby-2050.stat
>
>
> CachedItem's state is currently recorded in bit fields of an integer variable. Changing this to 6 boolean member variables reduces cpu usage.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-2050) Manipulating CachedItems could be
more efficient
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-2050?page=comments#action_12447836 ]
Knut Anders Hatlen commented on DERBY-2050:
-------------------------------------------
I don't think this should affect memory usage much since the JVM seems to allocate multiples of 8 bytes. I used DTrace to compare the object sizes for one class with 2 ints and one object reference (like CachedItem), and one class with one int, six booleans and one object reference. Both object types used 24 bytes.
> Manipulating CachedItems could be more efficient
> ------------------------------------------------
>
> Key: DERBY-2050
> URL: http://issues.apache.org/jira/browse/DERBY-2050
> Project: Derby
> Issue Type: Improvement
> Components: Performance
> Affects Versions: 10.2.1.6
> Reporter: Dyre Tjeldvoll
> Priority: Trivial
> Fix For: 10.3.0.0
>
>
> CachedItem's state is currently recorded in bit fields of an integer variable. Changing this to 6 boolean member variables reduces cpu usage.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (DERBY-2050) Manipulating CachedItems could be more
efficient
Posted by "Dyre Tjeldvoll (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-2050?page=all ]
Dyre Tjeldvoll updated DERBY-2050:
----------------------------------
Attachment: derby-2050.v2.diff
New patch which
- restores the deleted comment
- removes unintended white space changes
- restores the deleted final keywords
Deletion was not intentional. I wanted to remove the final keywords that I had added myself, and did not notice that I removed some of the existing ones. I decided to remove the final keywords I which I had added since I noticed that the class itself was declared final. Is there some added benefit to declaring methods in a final class as final?
> Manipulating CachedItems could be more efficient
> ------------------------------------------------
>
> Key: DERBY-2050
> URL: http://issues.apache.org/jira/browse/DERBY-2050
> Project: Derby
> Issue Type: Improvement
> Components: Performance
> Affects Versions: 10.2.1.6
> Reporter: Dyre Tjeldvoll
> Priority: Trivial
> Fix For: 10.3.0.0
>
> Attachments: derby-2050.diff, derby-2050.stat, derby-2050.v2.diff
>
>
> CachedItem's state is currently recorded in bit fields of an integer variable. Changing this to 6 boolean member variables reduces cpu usage.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (DERBY-2050) Manipulating CachedItems could be more
efficient
Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dag H. Wanvik updated DERBY-2050:
---------------------------------
Derby Categories: [Performance]
> Manipulating CachedItems could be more efficient
> ------------------------------------------------
>
> Key: DERBY-2050
> URL: https://issues.apache.org/jira/browse/DERBY-2050
> Project: Derby
> Issue Type: Improvement
> Affects Versions: 10.2.1.6
> Reporter: Dyre Tjeldvoll
> Assignee: Dyre Tjeldvoll
> Priority: Trivial
> Fix For: 10.3.1.4
>
> Attachments: derby-2050.diff, derby-2050.stat, derby-2050.v2.diff
>
>
> CachedItem's state is currently recorded in bit fields of an integer variable. Changing this to 6 boolean member variables reduces cpu usage.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2050) Manipulating CachedItems could be
more efficient
Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-2050?page=comments#action_12447828 ]
Daniel John Debrunner commented on DERBY-2050:
----------------------------------------------
How would memory usage compare with six booleans to one integer?
> Manipulating CachedItems could be more efficient
> ------------------------------------------------
>
> Key: DERBY-2050
> URL: http://issues.apache.org/jira/browse/DERBY-2050
> Project: Derby
> Issue Type: Improvement
> Components: Performance
> Affects Versions: 10.2.1.6
> Reporter: Dyre Tjeldvoll
> Priority: Trivial
> Fix For: 10.3.0.0
>
>
> CachedItem's state is currently recorded in bit fields of an integer variable. Changing this to 6 boolean member variables reduces cpu usage.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-2050) Manipulating CachedItems could be
more efficient
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-2050?page=comments#action_12448155 ]
Knut Anders Hatlen commented on DERBY-2050:
-------------------------------------------
I haven't tested the performance impact, but I definitely think the patch makes the code cleaner. A couple of small comments:
* The final keyword has been removed from the definition of isKept() and isValid(). Was that intentional?
* The comment in settingIdentityComplete() was deleted, but I think it's still relevant.
* White-space changes in unkeep() and use(). Blanks inserted in front of the tabs.
> Manipulating CachedItems could be more efficient
> ------------------------------------------------
>
> Key: DERBY-2050
> URL: http://issues.apache.org/jira/browse/DERBY-2050
> Project: Derby
> Issue Type: Improvement
> Components: Performance
> Affects Versions: 10.2.1.6
> Reporter: Dyre Tjeldvoll
> Priority: Trivial
> Fix For: 10.3.0.0
>
> Attachments: derby-2050.diff, derby-2050.stat
>
>
> CachedItem's state is currently recorded in bit fields of an integer variable. Changing this to 6 boolean member variables reduces cpu usage.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira