Basically the core issues in the adjustment routine stem from a few key points.
Firstly the adjustment routine is basically the same as the routine that was used in the DOS version of Navision. Yes its been updated, but logically (except for date handling) its about the same. I wrote an Add-On many years ago called Stock Manager, and it handled costing really well, but really only for FIFO. And that was the market it was written for. In writting that Add-On, I got to understand costing really well in Navision, and that’s probably why I never recommend a client ot use Average costing in Navision. [:P] The way stock Manager worked was to maintain cost adjustments in a seperate table, whilst keeping quantities and base cost in the Item Ledger Entry Table. (This was about 5 years before Navision introduced Value Entries). When 3.00 (Solutions [W]) came out, my first though was that this was a better solution, since it gave better reporting ability for date based inventroy reports. I soon changed my mind.
In an ideal world, Navision would handle average costing in a seperate Vlaue Entry table, and process and optimize it totally differntly. And that leads to the next issue. The Adjust cost routine is a very versitile process that does everything. This means it does a great job at getting the costs right, but its checking and testing too many things, which maybe the user will never need tested. And as the system evolved, a change to Specific costing with Serial numbers affects average cost, and the fix to average cost affects standard cost, and around it goes.
The correct solution with the Cost Adjust issue, really is to start again. And to seperate functional areas and only adjust what needs to be adjusted. Beter use of flags to filter out entries that are not needed to be adjusted for example. And the routine should be configurable, so if a client decides that they will never need a particular feature, deactivate it totally, and thus simplify the process. Of course a key starting point would be to get a true definition (for Navision purposes) of what average cost actually should be, since if you get three accountants in a room together, they will produce at least four definitions of Average cost.
In the meantime as Henrik says there are many ways to improve the performance of the Inventory cost routine, unfortunately to get real performance boosts (say 10 times) then you need to optimize the code specifically to the cleint, and that means a lot of customized development work. If you are a NSC or ISV in a vertical industry, then you could justiy the cost to create a specific routine for your client base, but I think for most clients the cost would be prohibitive.
If there was a market for it, I would love to do it, but in reality, in doing something like this, the code is 5% of the project, 90% is working out the ideal design, which can’t really be protected.