Opened 8 years ago

Closed 3 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:


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]


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:1 by Elinvention, 8 years ago

Mediagoblin version 0.9.0, my OS is Debian testing, hardware OLinuXino A20 LIME2 (see 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

Last edited 8 years ago by Elinvention (previous) (diff)

comment:2 by Christopher Allan Webber, 8 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 Ben Sturmfels, 8 years ago

Keywords: medium added
Status: newaccepted

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 Ben Sturmfels, 3 years ago

Resolution: no-action-required
Status: acceptedclosed

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.


Note: See TracTickets for help on using tickets.