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

Benchmark tests #7

Open
nickl- opened this issue Aug 17, 2012 · 0 comments
Open

Benchmark tests #7

nickl- opened this issue Aug 17, 2012 · 0 comments
Milestone

Comments

@nickl-
Copy link
Member

nickl- commented Aug 17, 2012

Since the only valid excuse for ignoring the context export resulting from calling include as discovered in #6 is a speculative performance knock it would be interesting to verify just how significant this sacrifice actually is.

What I am thinking is 100 vendors x 100 projects x 100 class files = 1 million includes.

The PSR-0 benchmark class

<?php
namespace Vendor1\Project1;

if (isset($this) && $this->ignoranceTax) {
    $class = __NAMESPACE__.'\\'.pathinfo(__FILE__, PATHINFO_FILENAME);
    return new $class();
}

class Class1 {}

That should suffice enough punishment over a million and switchable on the loader so we can compare the differences between straight method unpunished, closure, and context-less function.

This current lis benchmark testis:
exists

  • @include
  • file_exists()
  • SplFileInfo::isFile()
  • SplFileInfo::isReadable()
  • posix_access(POSIX_R_OK)

absolute path

  • realpath()
  • SplFileInfo::getRealPath()
  • stream_resolve_include_path
  • eio_realpath
  • path_info

how do I include you, let me count the ways

  • include in loader method un punished
  • include in loader method punished
  • include in loader static method un punished
  • include in loader static method punished
  • include in dynamic closure
  • include in loader property declared closure
  • include in loader static property declared closure
  • include in function
  • require in loader method un punished
  • require in loader method punished
  • require in loader static method un punished
  • require in loader static method punished
  • require in dynamic closure
  • require in loader property declared closure
  • require in loader static property declared closure
  • require in function
  • include relative path
  • require relative path
  • include absolute path
  • require absolute path

sudden death

  • include_path vs location_map

This list is a work in progress, if you can think of anything that is missing or something else you think would be worth our time to test in the same exercise all you need to do is ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant