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

Improve performance #78

Closed
Keats opened this issue May 31, 2017 · 10 comments
Closed

Improve performance #78

Keats opened this issue May 31, 2017 · 10 comments

Comments

@Keats
Copy link
Collaborator

Keats commented May 31, 2017

Integration tests are very annoying to write/change and benching could use some scripts to generate some big (.gitignored) websites and then have benchmarks on it

I don't really have any idea for the testing part so any help is welcome

@Keats
Copy link
Collaborator Author

Keats commented Jun 16, 2017

@Keats
Copy link
Collaborator Author

Keats commented Jun 19, 2017

The flaky issue is with the categories integration test:

thread 'can_build_site_with_categories' panicked at 'assertion failed: `(left == right)` (left: `1`, right: `2`)', tests/site.rs:200

Edit: this is fixed

@Keats
Copy link
Collaborator Author

Keats commented Jun 20, 2017

So for the benches I envision a script generating various (gitignored) scenarios:

Both blog scenarios should have one bench each for syntax highlighting turned on/off
I think anything smaller would not really make sense to benchmark.

cc @williamyaoh I'll write the script today or tomorrow if possible so we have a baseline to compare with

@Keats
Copy link
Collaborator Author

Keats commented Jun 20, 2017

Script added in cfcc4e7 and I think we have a case of https://accidentallyquadratic.tumblr.com/ :D

It's super slow even for 250 articles. I'll dig into that tomorrow or later this week. The slowness is not from the loading which happens pretty fast (130ms for 300 pages) but the Site::build.
I'm wondering if I'm not going too crazy with the nested serialization with paginations etc

@Keats
Copy link
Collaborator Author

Keats commented Jun 21, 2017

For the "fast" part, the loading:

2017-06-21-145401_921x485_scrot

Note that 1000 pages 'only' take 1.7s to read and render markdown without syntax highlighting so it's not TOO bad but can obviously be made non n^2

I've pushed the loading benchmarks on the next branch, next is make it fast

@Keats
Copy link
Collaborator Author

Keats commented Jun 21, 2017

Made it linear in 414457e

@Keats
Copy link
Collaborator Author

Keats commented Jun 21, 2017

So for the loading, the last (obvious) hanging fruit afaik is that loop: https://github.com/Keats/gutenberg/blob/master/src/site.rs#L98

If i hack together a par_iter that does roughly the same, it's around 50% faster. The issue is that I have no clue how to modify self in the parallel iterator or if it's even doable. Too late to investifate more.

@williamyaoh
Copy link
Contributor

williamyaoh commented Jun 22, 2017 via email

@Keats
Copy link
Collaborator Author

Keats commented Jun 22, 2017 via email

@Keats Keats changed the title Improve testing and benching Improve performance Jun 22, 2017
@Keats Keats mentioned this issue Jun 22, 2017
10 tasks
@Keats
Copy link
Collaborator Author

Keats commented Jun 22, 2017

Pushed b158ca7

 name                                                current.bench ns/iter  now.bench ns/iter  diff ns/iter   diff %  speedup 
 bench_loading_big_blog                              164,714,894            129,928,686         -34,786,208  -21.12%   x 1.27 
 bench_loading_big_blog_with_syntax_highlighting     644,116,974            541,249,158        -102,867,816  -15.97%   x 1.19 
 bench_loading_medium_blog                           41,935,664             31,289,882          -10,645,782  -25.39%   x 1.34 
 bench_loading_medium_blog_with_syntax_highlighting  159,659,632            149,630,526         -10,029,106   -6.28%   x 1.07 
 bench_loading_medium_kb                             168,637,495            131,690,163         -36,947,332  -21.91%   x 1.28 
 bench_loading_medium_kb_with_syntax_highlighting    638,500,862            575,134,100         -63,366,762   -9.92%   x 1.11 
 bench_loading_small_blog                            4,625,168              3,454,008            -1,171,160  -25.32%   x 1.34 
 bench_loading_small_blog_with_syntax_highlighting   18,526,481             16,519,896           -2,006,585  -10.83%   x 1.12 
 bench_loading_small_kb                              15,476,227             11,794,476           -3,681,751  -23.79%   x 1.31 
 bench_loading_small_kb_with_syntax_highlighting     62,483,195             55,922,676           -6,560,519  -10.50%   x 1.12

@Keats Keats closed this as completed Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants