Mime-type editor, where to put it?

Nick Schermer nickschermer at gmail.com
Sun Jan 22 10:19:39 CET 2012


On Sun, Jan 22, 2012 at 9:46 AM, Stephan Arts <stephan at xfce.org> wrote:
> On Sat, Jan 21, 2012 at 9:26 PM, Nick Schermer <nickschermer at gmail.com> wrote:
>> On Sat, Jan 21, 2012 at 6:46 PM, Jannis Pohlmann <jannis at xfce.org> wrote:
>>> On Sat, 21 Jan 2012 17:05:58 +0100
>>> Nick Schermer <nickschermer at gmail.com> wrote:
>>>
>>>> Code is in the nick/mime-settings branch of xfce4-settings.
>>>
>>> I just had a quick look at it. Here's my comments:
>>>
>>> * Small icons next to the MIME types and application names would be
>>>  useful IMHO, as they could help finding things more quickly.
>>
>> True-ish, but loading ~600 icons is not a good idea...
>
> Agreed, lets do some math:
>
> 16x16 = 256 pixels
> 256x32 = 8.192 bytes (considering ARGB)
>
> 600x8192 = 4.915.200 bytes ( ~ 5MB)
>
> add a 20% overhead for the objects... (which is huge), then we end up at 6MB
>
> Ok, doing 600 round-trips to the filesystem is not a good idea, and
> using 6MB just for icons is a lot too.
>
> But can't we figure out a solution to that?
> For example, only loading those visible to the user (so, 15-25-ish)
> should not be a problem?

Tried it:

3.0 MiB +   1.0 MiB =   4.0 MiB	xfce4-mime-settings-noicon
user	0m1.147s
sys	0m0.080s

5.0 MiB +   1.6 MiB =   6.6 MiB	xfce4-mime-settings-icons
user	0m1.237s
sys	0m0.143s

That is for all mimes loading icons (if they have an icon!), 677 on my netbook.

Nick


More information about the Xfce4-dev mailing list