Skip to content

Conversation

@ablyler
Copy link
Contributor

@ablyler ablyler commented Aug 9, 2015

  • use forking to process files in parallel (need for large code bases)
  • add support for specifing rulesets in the config

Note: I switched to from Alpine to Ubuntu for now because Alpine doesn't have php-pcntl support, which was needed for forking. I submitted a patch to Alpine to get php-pcntl support added.

- use forking to process files in parallel (need for large code bases) - add support for specifing rulesets in the config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do result files get stored? (We'll need to ensure it's within /tmp)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw the reference to sys_get_temp_dir, so this should be OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got it.

@brynary
Copy link
Contributor

brynary commented Aug 10, 2015

Hi @ablyler -- Thanks for this. I think this is going to be a big improvement. I added some line notes for questions/suggestions, but this seems really close.

@ablyler
Copy link
Contributor Author

ablyler commented Aug 14, 2015

@brynary everything should be all fixed up. also just changed the base back to alpine linux, now that they accepted my php-pcntl addition. :-)

@brynary
Copy link
Contributor

brynary commented Aug 14, 2015

@ablyler looks great. Ready to merge, just one more thing... 20 forks processing files simultaneously is probably too many (which would cause a slowdown due to unnecessary CPU switching).

For our CodeClimate.com system, we'll allocate 2 CPUs to this, so we should probably run with a concurrency of about 2 or 3. (We can allow this to be overridden with an environment variable for local usage and on-premise deployments with different resource constraints as well, in the future.)

- did some performance testing after @brynary comment in GitHub and found that 3 performs best on my large code bases
@ablyler
Copy link
Contributor Author

ablyler commented Aug 16, 2015

@brynary good call, did some testing, 3 appears to be a good setting.

brynary added a commit that referenced this pull request Aug 17, 2015
add parallel phpmd processing and polish
@brynary brynary merged commit 05900c8 into qltysh-archive:master Aug 17, 2015
@brynary
Copy link
Contributor

brynary commented Aug 17, 2015

Merged. Thanks for all the help on this, @ablyler!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants