Skip to content

IPC files on Android #8762

Open
Open

Description

@mmatyas

I'm testing canvas performance on Android, and noticed some problems with IPC (servo/ipc-channel) there. Servo seems to be creating IPC 'shared memory' files on every canvas redraw, on the sdcard, and they remain there until you manually delete them. With a big animated canvas, this means megabytes every second, and if there's no more space, pages simply stop loading.

Of course, using the sdcard like this is also a performance problem. So I've changed the path of these files in ipc-channel to a small ramdisk/tmpfs I've created, and it caused a visible improvement in the smoothness of the canvas animation (no exact numbers yet, sorry).

I'm not too familiar with how exactly this works on Android, can we fix these problems somehow? It would be nice to not need to store these files at all, or write them to eg. /data/data/org.mozilla.servo What do you think? @pcwalton?

Activity

  1. added
    I-perf-bloat
    I-perf-slow
    on Dec 1, 2015
  2. vvuk commented on Dec 1, 2015

    @vvuk
    Contributor

    shmem should not be hitting the disk/flash at all.. the filesystem name should just be a name. If stuff is actually being written (especially living until they're deleted), it likely means that something about android's IPC/shmem isn't what servo is expecting.

  3. larsbergstrom commented on Dec 1, 2015

    @larsbergstrom
    Contributor

    Thanks for finding this, @mmatyas!

    The current code just works around a bunch of bionic bugs with shmem. I'd welcome any changes! If you do have to write anything to the app directory, we do have to be careful to get it from the application at startup, as AFAIK it's not actually constant and the app will actually only have write access to the "real" one (e.g. /data/data/org.mozilla.servo1).

  4. pcwalton commented on Dec 1, 2015

    @pcwalton
    Contributor

    Ugh. This is exactly the reason why memfd exists, but it's too new for us to rely on it.

  5. vvuk commented on Dec 2, 2015

    @vvuk
    Contributor

    Hmm, why? Servo is forward looking, it should use forward looking tech.. especially on mobile :)

  6. larsbergstrom commented on Dec 2, 2015

    @larsbergstrom
    Contributor

    I've been a little reluctant to move our minimum Android platform up so that we could try to share components with Gecko (so, WinXP, OSX 10.6, older Android, etc.). But maybe we could do that on a more component-level basis and use newer features in either components that either will stay Servo-only or have multiple codepaths for different targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-perf-bloatI-perf-slow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions