Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create SimpleFile only when writing the content #19493

Merged
merged 4 commits into from
Feb 28, 2020
Merged

Commits on Feb 28, 2020

  1. better tests for SimpleFolder

    test behavior, not implementation
    
    Signed-off-by: Robin Appelman <[email protected]>
    icewind1991 authored and rullzer committed Feb 28, 2020
    Configuration menu
    Copy the full SHA
    fed86e8 View commit details
    Browse the repository at this point in the history
  2. Create SimpleFile only when writing the content

    instead of first creating an empty file and then writing the content.
    
    This solves the overhead of creating an empty file with the common pattern:
    
    ```php
    $file = $simpleFilder->newFile('foo.txt');
    $file->putContent('bar.txt');
    ```
    
    roughly halving the number of storage and database operations that need to be done when creating a `SimpleFile`.
    
    This is not automatically done with `File` because that has a more complex api which I'm more hesitant to touch.
    Instead the `Folder::newFile` api has been extended to accept the content for the new file.
    
    In my local testing, the overhead of first creating an empty file took about 20% of the time for preview generation
    
    Signed-off-by: Robin Appelman <[email protected]>
    icewind1991 authored and rullzer committed Feb 28, 2020
    Configuration menu
    Copy the full SHA
    5ca1929 View commit details
    Browse the repository at this point in the history
  3. allow writing content directly when creating new SimpleFile

    Signed-off-by: Robin Appelman <[email protected]>
    icewind1991 authored and rullzer committed Feb 28, 2020
    Configuration menu
    Copy the full SHA
    63608ef View commit details
    Browse the repository at this point in the history
  4. Bump autoloader

    Signed-off-by: Roeland Jago Douma <[email protected]>
    rullzer committed Feb 28, 2020
    Configuration menu
    Copy the full SHA
    245125d View commit details
    Browse the repository at this point in the history