Complete package (without the weidu executable):
http://poisson.dm.unipi.it/~bigiani/files/test.rar.
Basically, I'm using READ_2DA_ENTRY on a 220 Kb file, which is composed of two coloumns: the first short (a file name), the second long (an item description, coded to remove spaces and newlines), eg
BRUENPLA Mithral___SPACE___Field___SPACE___Plate___SPACE___+2:___SPACE______NL___This___SPACE___is___SPACE___the___SPACE___personal___SPACE___armor___SPACE___of___SPACE___Bruenor___SPACE___Battlehammer,___SPACE___and___SPACE___never___SPACE___a___SPACE___finer___SPACE___kit___SPACE___have___SPACE___you___SPACE___seen.___SPACE______SPACE___It___SPACE___is___SPACE___truly___SPACE___a___SPACE___marvel___SPACE___of___SPACE___battlefield___SPACE___craftsmanship.___SPACE______NL___STATISTICS:___NL___Resistance___SPACE___to___SPACE___slashing___SPACE___damage:___SPACE___30___NL___Resistance___SPACE___to___SPACE___piercing___SPACE___damage:___SPACE___15___NL___Resistance___SPACE___to___SPACE___blunt___SPACE___damage:___SPACE___5___NL___Resistance___SPACE___to___SPACE___missile___SPACE___damage:___SPACE___35___NL___Dexterity___SPACE___penalty:___SPACE___5___NL___Penalty___SPACE___to___SPACE___movement:___SPACE___25___NL___Spell___SPACE___failure:___SPACE___45___NL___Penalty___SPACE___to___SPACE___pick___SPACE___pocket:___SPACE___90___NL___Penalty___SPACE___to___SPACE___lock___SPACE___picking:___SPACE___60___NL___Penalty___SPACE___to___SPACE___trap___SPACE___finding___SPACE___and___SPACE___disarming:___SPACE___65___NL___Penalty___SPACE___to___SPACE___Move___SPACE___Silently:___SPACE___95___NL___Penalty___SPACE___to___SPACE___hide___SPACE___in___SPACE___shadows:___SPACE___90___NL___Armor___SPACE___Class:___SPACE___-1___NL___Weight:___SPACE___45___NL___Not___SPACE___Usable___SPACE___By:___NL______SPACE___Bard___NL______SPACE___Druid___NL______SPACE___Mage___NL______SPACE___Thief___NL______SPACE___Archer___NL______SPACE___Stalker___NL______SPACE___Barbarian___NL______SPACE___Beast___SPACE___Master___NL______SPACE___Kensai___NL______SPACE___Monk
(there are 110 lines, totalling 220 kb of text).
This in order to automate those lines of
COPY_EXISTING ~a.itm~ ~override~
SAY DESC @1
SAY UNIDENTIFIED_DESC @2
we all so like typing.
However, using READ_2DA_ENTRY on this beast is really slow.
This code (which only reads the filenames until it finds the correct one) takes one minute and an half, while the rest of the whole component (including READ_2DA_ENTRY on the real description, turning it into human-readable form, SAYing it, and otherwise patching the file) doesn't slow more than 10 seconds.
If you pay attention to file you're operating on (via the PATCH_PRINT I added), you'll see that items not on the 2da listing (non-armor and non-shield items) are processed istantly, while items at the top of the list (eg CHAN*) are decently quick, and the ones at the bottom of the list (SHLD*, WA*) are the slowest, with even a second per one for the very last ones.
So, I was wondering if it's possible to find a way to speed this up, maybe with something alike to the SET_2DA_ENTRY_LATER/SET_2DA_ENTRIES_NOW combo, via READ_2DA_ENTRIES_NOW/READ_2DA_ENTRY_FORMER: while successive S_2_E_L memorize the changes to be applied in the RAM rather than in the file and S_2_E_N flushes all changes to the file in one go, R_2_E_N will read all entries in the RAM in one go, and then R_2_E_F will return the value from the RAM, rather than from the file.