Opened 9 years ago
Closed 4 years ago
#5452 closed enhancement (no-action)
Slow gmg command
Reported by: | Elinvention | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | programming | Keywords: | medium |
Cc: | Parent Tickets: |
Description
On my tiny home server, the gmg command takes ages just to show the usage message. I think the first thing it should do is parsing the command line and possibly throw errors immediately. Only after that import all other required modules.
% time ./bin/gmg
usage: gmg [-h] [-cf CONF_FILE]
{batchaddmedia,shell,adduser,assetlink,makeadmin,reprocess,serve,deleteuser,addmedia,dbupdate,deletemedia,changepw,alembic}
...
gmg: error: too few arguments
./bin/gmg 6,30s user 2,89s system 86% cpu 10,612 total
6,30 seconds just to list possible commands!!! I'd say it's a bit unresponsive.
Change History (4)
comment:2 by , 9 years ago
Yes, we'd have to do some tricks to make this not import as much as it has to. I seem to recall that part of the reason it's so slow is it pulls up a full copy of the application for plugin hooks reasons, but I could well be wrong.
comment:3 by , 8 years ago
Keywords: | medium added |
---|---|
Status: | new → accepted |
Marking as medium-sized. Will require some experience with profiling to review the CPU, memory and hard-disk usage. May require substantial changes to bring some of the error handling to earlier in the process.
comment:4 by , 4 years ago
Resolution: | → no-action-required |
---|---|
Status: | accepted → closed |
Thanks for the bug report Elinvention, and sorry for the slow response.
I'm marking this as "no-action", because optimising MediaGoblin's gmg
isn't something we're likely to spend time on in the near future.
Regards,
Ben
My OS is Debian testing, hardware OLinuXino A20 LIME2 (see https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXIno-LIME2-4GB/open-source-hardware) with 1GB of RAM, I'm using python2.
I also tried on a much more powerful machine with 16GB of RAM, AMD FX-8320 and python3, but it's still slow: gmg 1,03s user 0,06s system 98% cpu 1,104 total