ObjFW  Ticket Change Details

Overview

Artifact ID: e8e1d99b1aff3a9d0401bf179b31a9ab79eb5ef2752015158918c8b4a1449c9c
Ticket: c34a429b8cd54bc99eaad51fa400932cf48db300
Optimize initWithContentsOfIRI: with file: IRIs
User & Date: js on 2022-10-20 16:41:25
Changes

  1. icomment:
    Currently this goes through the `OFURIHandler` for `file:`. This means the generic code is used that grows a buffer, while `-[initWithContentsOfFile:]` is more optimized and only needs to allocate the buffer once. It would make sense to either add a specialization to fall back to `-[initWithContentsOfFile:]` on `file:` or to generalize it and always check if the returned stream is a `OFSeekableStream`, allowing to just seek to the end of the stream to get its size. However, for networked protocols, that *might* have negative performance implications, so it might be safer to just add a specialization for `file:`.
    
  2. login: "js"
  3. milestone changed to: "none"
  4. mimetype: "text/x-markdown"
  5. priority changed to: "Medium"
  6. severity changed to: "Minor"
  7. status changed to: "Open"
  8. title changed to: "Optimize initWithContentsOfURI: with file: URIs"
  9. type changed to: "Enhancement"