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

Mock out the filesystem entirely? #2

Open
donquixote opened this issue Jul 19, 2013 · 1 comment
Open

Mock out the filesystem entirely? #2

donquixote opened this issue Jul 19, 2013 · 1 comment

Comments

@donquixote
Copy link
Contributor

Hi,
I have been experimenting with class loader benchmarks some time myself, and came to the conclusion that the biggest source of statistic variation is probably the filesystem.

You already removed every require/include.. so what about also removing or mocking out file_exists() ?

The idea would be to measure the time for the basic algorithm (foreach loops and string operations) and then count the number of file_exists() and require. Where require is probably pointless, because this is going to be the same with each loader.

This can be done either by giving each loader a MockFilesystem, or by having a class with static methods, e.g. MockFilesystem::file_exists(). I'd say the mock object is more elegant.

There could also be a version of the MockFilesystem that actually does the file_exists(), and another one which doesn't.. this would add one level of indirection, but maybe that's ok? (because it is evenly distributed, every loader has to go through it)

@Seldaek
Copy link
Owner

Seldaek commented Jul 25, 2013

I sort of agree, but how do you quantify file_exists calls then? That's pretty hard. I think it has to remain fairly realistic to have any value. But yeah maybe benchmraking with/without would be the best to see the impact.

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

2 participants