Optimise async I/O on GResourceFile streams
@pwithnall
Submitted by Philip Withnall Link to original bug (#744392)
Description
It was pointed out on the mailing list that async I/O calls on GResourceFile streams create worker threads pointlessly, since the backing data for a GResourceFile is already in memory.
https://mail.gnome.org/archives/desktop-devel-list/2015-February/msg00074.html
I haven’t investigated fully (and don’t have time to; this bug is just so the problem doesn’t get forgotten), but here are two suggestions for fixes:
-
Implement the async vfuncs for GResourceFileInputStream and GResourceFileOutputStream to return results directly.
-
Create a new GMemoryBased interface and implement it on GResourceFileInputStream and GResourceFileOutputStream. The base stream classes could then implement a fast path for objects implementing that interface, just as with GFileDescriptorBased. Better suggestions welcome for the name. Suggested API: GBytes *g_memory_based_get_bytes (GMemoryBased *self);
Version: 2.43.x