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

ApiGen 5 is way slower than 4 #1015

Open
nijel opened this Issue Oct 2, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@nijel

nijel commented Oct 2, 2017

When using ApiGen 5, I've noticed it's way slower than 4 used to be. Actually speed and low memory usage was primary reasons for us using ApiGen and those seem to be gone with upcoming release.

On phpMyAdmin's SQL Parser it's more than 250 times slower (from 2.5 seconds to 622 seconds). The memory usage went 16 times up (from 80 MB to 1.2 GB). This is simply blocker for us.

For ApiGen 5:

$ /usr/bin/time -v ./vendor/bin/apigen generate --destination doc src/
Parsing reflections (this may take a while)... done!
Generating documentation...
 176/176 [============================] 100% 10 mins/10 mins 1.2 GiB. done!
Your documentation has been generated successfully!
	Command being timed: "./vendor/bin/apigen generate --destination doc src/"
	User time (seconds): 622.56
	System time (seconds): 10.27
	Percent of CPU this job got: 99%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 10:33.63
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 1286468
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 5661
	Voluntary context switches: 14
	Involuntary context switches: 26994
	Swaps: 0
	File system inputs: 0
	File system outputs: 12856
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0

ApiGen 4:

$ /usr/bin/time -v ./vendor/bin/apigen generate --destination doc --source src/
Scanning sources and parsing
Found 80 classes, 0 constants and 0 functions
Generating API documentation
100 % - Finished!
	Command being timed: "./vendor/bin/apigen generate --destination doc --source src/"
	User time (seconds): 2.42
	System time (seconds): 0.05
	Percent of CPU this job got: 99%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:02.49
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 79488
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 2742
	Voluntary context switches: 2
	Involuntary context switches: 142
	Swaps: 0
	File system inputs: 0
	File system outputs: 13448
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0

nijel added a commit to phpmyadmin/scripts that referenced this issue Oct 2, 2017

Revert "Use newer apigen (4.x is no longer supported)"
This reverts commit 9e1fe35.

It is way slower and consumes too much memory, see
ApiGen/ApiGen#1015

nijel added a commit to phpmyadmin/sql-parser that referenced this issue Oct 2, 2017

Use apigen 4.1
It runs much faster, see ApiGen/ApiGen#1015

Signed-off-by: Michal Čihař <michal@cihar.com>
@dga26

This comment has been minimized.

Show comment
Hide comment
@dga26

dga26 Oct 19, 2017

hi @nijel
i have the same problem on master branch.
on Windows memory grows up dangerously only for 2 directories parse.

From 100mo to more than 4go not reaching the end of the apigen generation step...

Regards

(i use github clone of the project)

dga26 commented Oct 19, 2017

hi @nijel
i have the same problem on master branch.
on Windows memory grows up dangerously only for 2 directories parse.

From 100mo to more than 4go not reaching the end of the apigen generation step...

Regards

(i use github clone of the project)

@TonyBogdanov

This comment has been minimized.

Show comment
Hide comment
@TonyBogdanov

TonyBogdanov Jan 6, 2018

+1 for this.

I have a project of 6 PHP classes, yeah 6, and generating docs for them takes more than a minute on Windows (and my setup is pretty solid, it's no potato PC) with ~400MB RAM. If I also include the tests folder (another 6 files) it runs for about 16 minutes up to around 48%, RAM spikes up to 1.6 GB and then it just dies complaining that class X does not exist (X is different each time).

Maybe there's some kind of monstrous recursion or some other limit being reached?

Either way ApiGen 5 is simply useless at this point, to add to that I don't see any options for the generate command whatsoever, or at least some docs for the apigen.yml configuration.

And yeah, I know version 5 is still RC, but I am unable to make 4.1.2 run either due to so many deprecated packages and conflicts. Even on completely clean install (even with the --debug option) it goes through Scanning sources and parsing then immediately Unexpected token found. and dies with no other info available.

TonyBogdanov commented Jan 6, 2018

+1 for this.

I have a project of 6 PHP classes, yeah 6, and generating docs for them takes more than a minute on Windows (and my setup is pretty solid, it's no potato PC) with ~400MB RAM. If I also include the tests folder (another 6 files) it runs for about 16 minutes up to around 48%, RAM spikes up to 1.6 GB and then it just dies complaining that class X does not exist (X is different each time).

Maybe there's some kind of monstrous recursion or some other limit being reached?

Either way ApiGen 5 is simply useless at this point, to add to that I don't see any options for the generate command whatsoever, or at least some docs for the apigen.yml configuration.

And yeah, I know version 5 is still RC, but I am unable to make 4.1.2 run either due to so many deprecated packages and conflicts. Even on completely clean install (even with the --debug option) it goes through Scanning sources and parsing then immediately Unexpected token found. and dies with no other info available.

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