[ http://issues.apache.org/jira/browse/DERBY-2122?page=all ]
Knut Anders Hatlen updated DERBY-2122: -------------------------------------- Attachment: derby-2122-v1.diff derby-2122-v1.stat The attached patch removes the compatibility matrix from ContainerLock and instead maintains a bit mask containing the type ids of the compatible lock types. Compatibility checking between two lock types could therefore be performed by a bitwise and of the the bit mask and the type id. Similar changes were made to RowLock to keep the two classes consistent. I have run some experiments with this patch and the test client from DERBY-1961 (single-record selects with 16 concurrent clients on embedded Derby). Experiment 1: 40 runs (20 with clean trunk, 20 with patch for ContainerLock only) consisting of 30 seconds warm-up and 60 seconds counting transactions. Result: Average throughput increased by 1.2% with the patch. Experiment 2: Same as above, but counting transactions for 100 seconds instead of 60 seconds. Result: Average throughput increased by 1.7% with the patch. Experiment 3: Same as above, but with the full patch (that is, both ContainerLock and RowLock changed). Result: Average throughput increased by 1.9% with the patch. I don't have a fancy script that calculates how significant these numbers are (can do it on request, since I really need to refresh my statistics skills), but they at least give an indication that the patch has a small positive impact. Reviews would be appreciated. Thanks. > Optimize ContainerLock.isCompatible() > ------------------------------------- > > Key: DERBY-2122 > URL: http://issues.apache.org/jira/browse/DERBY-2122 > Project: Derby > Issue Type: Improvement > Components: Store, Performance > Affects Versions: 10.2.1.6 > Reporter: Knut Anders Hatlen > Assigned To: Knut Anders Hatlen > Priority: Trivial > Attachments: derby-2122-v1.diff, derby-2122-v1.stat > > > The numbers at http://wiki.apache.org/db-derby/Derby1961MethodCalls indicate > that ContainerLock.isCompatible() is called many times per transaction, at > least when there are multiple concurrent clients operating on the same > containers. Currently, it looks into a two-dimensional array to find out > whether two locks are compatible. This could be implemented more efficiently, > for instance by having a bit pattern in each ContainerLock object > representing which lock types it is compatible with. -- 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