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

Performance optimizations #389

Merged
merged 8 commits into from
Oct 18, 2019
Merged

Performance optimizations #389

merged 8 commits into from
Oct 18, 2019

Conversation

colinodell
Copy link
Member

Alternative PR to #388 with many of the same optimizations. A huge thanks to @ricardofiorani for implementing most of these! 🎉

Before:

Running Benchmarks (Isolated), 7 Implementations, 20 Iterations:
	CommonMark                     ....................
	PHP Markdown                   ....................
	PHP Markdown Extra             ....................
	Parsedown                      ....................
	cebe/markdown                  ....................
	cebe/markdown gfm              ....................
	cebe/markdown extra            ....................

Benchmark Results, CPU:
	1) Parsedown                    1.67 ms              
	2) cebe/markdown                1.74 ms      -0.07 ms
	3) cebe/markdown extra          2.01 ms      -0.34 ms
	4) cebe/markdown gfm            2.45 ms      -0.78 ms
	5) PHP Markdown                 3.09 ms      -1.42 ms
	6) PHP Markdown Extra           4.25 ms      -2.58 ms
	7) CommonMark                  20.65 ms     -18.98 ms

Benchmark Results, Peak Memory:
	1) PHP Markdown                 2662 kB              
	2) Parsedown                    2806 kB       -144 kB
	3) PHP Markdown Extra           2898 kB       -236 kB
	4) cebe/markdown                2912 kB       -250 kB
	5) cebe/markdown extra          2982 kB       -320 kB
	6) cebe/markdown gfm            3337 kB       -675 kB
	7) CommonMark                   6761 kB      -4099 kB

After:

Running Benchmarks (Isolated), 7 Implementations, 20 Iterations:
	CommonMark                     ....................
	PHP Markdown                   ....................
	PHP Markdown Extra             ....................
	Parsedown                      ....................
	cebe/markdown                  ....................
	cebe/markdown gfm              ....................
	cebe/markdown extra            ....................

Benchmark Results, CPU:
	1) Parsedown                    1.58 ms              
	2) cebe/markdown                1.71 ms      -0.13 ms
	3) cebe/markdown extra          2.00 ms      -0.42 ms
	4) cebe/markdown gfm            2.36 ms      -0.78 ms
	5) PHP Markdown                 2.92 ms      -1.34 ms
	6) PHP Markdown Extra           4.28 ms      -2.70 ms
	7) CommonMark                  17.93 ms     -16.35 ms

Benchmark Results, Peak Memory:
	1) PHP Markdown                 2666 kB              
	2) Parsedown                    2810 kB       -144 kB
	3) PHP Markdown Extra           2902 kB       -236 kB
	4) cebe/markdown                2916 kB       -250 kB
	5) cebe/markdown extra          2986 kB       -320 kB
	6) cebe/markdown gfm            3341 kB       -675 kB
	7) CommonMark                   6734 kB      -4068 kB

@colinodell colinodell added the performance Something could be made faster or more efficient label Oct 18, 2019
@colinodell colinodell self-assigned this Oct 18, 2019
@colinodell colinodell merged commit 6483aaf into master Oct 18, 2019
@colinodell colinodell deleted the performance-optmizations branch October 18, 2019 17:29
@colinodell colinodell added this to the v1.1.0 milestone Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Something could be made faster or more efficient
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants