Experiment with number cache. See AFScriptContext ... getObject.
AFResultValueFactory.create() is probably the best place to put the cache.
example data:
oracle 11g sys, sh.sales 100k rows
SQL Server 2005 - AdventureWorks
select * from Production.TransactionHistory
select * from Sales.SalesOrderDetail
select * from Production.TransactionHistoryArchive
select * from Production.WorkOrder
select * from Production.WorkOrderRouting
select * from Sales.SalesOrderHeader
select * from Sales.SalesOrderHeaderSalesReason
select * from dbo.Full_Log
select * from Person.Contact
select * from Person.Address
select * from Person.newtest3
select * from Sales.CustomerAddress
select * from Sales.Customer
select * from Sales.ContactCreditCard
select * from Sales.CreditCard
select * from Sales.Individual
select * from Sales.CurrencyRate
SQL Server 2005 - AdventureWorks
select * from Production.TransactionHistory
select * from Sales.SalesOrderDetail
select * from Production.TransactionHistoryArchive
select * from Production.WorkOrder
select * from Production.WorkOrderRouting
select * from Sales.SalesOrderHeader
select * from Sales.SalesOrderHeaderSalesReason
select * from dbo.Full_Log
select * from Person.Contact
select * from Person.Address
select * from Person.newtest3
select * from Sales.CustomerAddress
select * from Sales.Customer
select * from Sales.ContactCreditCard
select * from Sales.CreditCard
select * from Sales.Individual
select * from Sales.CurrencyRate
DataCache.DATA_CACHE_ENABLED
enables data compressor which eliminates duplicate instances in the context of a single query. This mechanism caches only immutable objects.
DataCache.NUMERIC_CACHE_ENABLED
adds static cache for small numeric values. My testing shows that any benefit (if any) is undetectable.
Here is a typical test result - 2005/AdventureWorks/Production.TransactionHistory:
(first number is allocated memory at the end of the query, second - the max memory, third - allocated memory after gc cycle)
1. without any caching:
140/240/144
141/188/134
2. data caching only
90/157/82
89/152/82
3. with data and numeric caching
90/143/82
91/158/82
Both caching mechanisms are currently disabled. Perhaps we should enabled them in 8.5 and do a PR campaign.
DataCache.DATA_CACHE_ENABLED
enables data compressor which eliminates duplicate instances in the context of a single query. This mechanism caches only immutable objects.
DataCache.NUMERIC_CACHE_ENABLED
adds static cache for small numeric values. My testing shows that any benefit (if any) is undetectable.
Here is a typical test result - 2005/AdventureWorks/Production.TransactionHistory:
(first number is allocated memory at the end of the query, second - the max memory, third - allocated memory after gc cycle)
1. without any caching:
140/240/144
141/188/134
2. data caching only
90/157/82
89/152/82
3. with data and numeric caching
90/143/82
91/158/82
Both caching mechanisms are currently disabled. Perhaps we should enabled them in 8.5 and do a PR campaign.
Issue #2971 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
example data:
oracle 11g sys, sh.sales 100k rows