Skip to Content.
Sympa Menu

sm-sorcery-bugs - [SM-Sorcery-Bugs] [Bug 9386] New: tablet_import_repair_files slow

sm-sorcery-bugs AT lists.ibiblio.org

Subject: Bugs for Sorcery are reported here

List archive

Chronological Thread  
  • From: bugzilla-daemon AT bugs.sourcemage.org
  • To: sm-sorcery-bugs AT lists.ibiblio.org
  • Subject: [SM-Sorcery-Bugs] [Bug 9386] New: tablet_import_repair_files slow
  • Date: 26 Mar 2006 19:19:40 -0000

http://bugs.sourcemage.org/show_bug.cgi?id=9386

Summary: tablet_import_repair_files slow
Product: Sorcery
Version: 1.14.x
Platform: Other
OS/Version: other
Status: NEW
Severity: minor
Priority: P2
Component: subroutines
AssignedTo: sm-sorcery-bugs AT lists.ibiblio.org
ReportedBy: pmahon AT sourcemage.org


tablet_import_repair_files is really slow to run. It has to go through all
tablet directories and subdirectories. On my system this takes > 2 minutes.


------- Additional Comments From pmahon AT sourcemage.org 2005-08-01 05:51
-------
Created an attachment (id=4448)
--> (http://bugs.sourcemage.org/attachment.cgi?id=4448&action=view)
--> (http://bugs.sourcemage.org/attachment.cgi?id=4448&action=view)
Possible fix

This makes it run in a second or two. It removes looking in most of the
subdirectories. It basicly only checks a tablet dir if there's a REPAIR file
in
a spell and a tablet directory.

--


------- Additional Comments From acedit AT armory.com 2005-08-01 16:04 -------
this patch will look in all grimoires for REPAIR files, but only in spell
directories, tablet_import_repair_files_page will only import them from the
first version of the spell found, but it also looks in the grimoire and
section
dirs.

Im also concerned since it does a find across all the grimoires, that can
amount
to a lot of slowdown if you have all the grimoires..

the slowdown in the current code is that theres a fork for each page,
regardless
of if there are repair files, we should do a codex lookup for each chapter and
see if there are REPAIR files in that section/spell/grimoire. if so, then
enter
the subroutine. That should amount to the subroutine rarely ever being called
instead of constantly being called (unless there are grimoire repair files in
which case theres nothing we can do).

--


------- Additional Comments From acedit AT armory.com 2006-03-26 13:19 -------
I did some benchmarking and eliminated a bunch of the forks. Unfortunately
that
had only very minor performance improvements. The bulk of the time seems to be
spent in codex_cache_spell_lookup.

On my system it takes about 55 seconds to 75 to run using the current code
depending on fs cache states.
I've managed to get it down to the high 40's by caching the common find
commands
and eliminating as many forks as possible (basenames, dirnames, the main
subroutine fork, and some in spell lookup).

If I comment out the actual repair work, the code runs in about 40 seconds,
thats just for pulling the spell name out of the tablet page name, and doing a
spell lookup on it. If I comment out the innermost grep -m "^spell ..."|tr
line
in the lookup the code runs in 12 seconds...

I'll try some more experiments to see if I can make it any faster.

The alternative to that is going with dufflebunks approach, which is to start
at
the grimoires and work backwards to the tablet. That ought to be faster so
long
as the number of repair files in all the grimoires doesnt get too large.

--
Configure bugmail: http://bugs.sourcemage.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



  • [SM-Sorcery-Bugs] [Bug 9386] New: tablet_import_repair_files slow, bugzilla-daemon, 03/26/2006

Archive powered by MHonArc 2.6.24.

Top of Page