judge-server icon indicating copy to clipboard operation
judge-server copied to clipboard

Use memfd for file data

Open Xyene opened this issue 4 years ago • 1 comments

We can create a memfd pointing to decompressed problem data, and pass that off to the submissions.

Pros:

  • no more piping necessary in judge; fewer context switches as a result
  • submissions can seek the fd
  • still no disk thrashing

Cons(?):

  • 3.7+ kernel necessary
  • extra memcpy

Xyene avatar Feb 13 '21 05:02 Xyene

Support for creation of memfd-backed files is implemented in #836, with unlinked temporary files as fallback on FreeBSD.

This should now be a matter of writing decompressed data into an MemoryIO instance and passing the fd to TracedPopen.

quantum5 avatar Feb 14 '21 07:02 quantum5