Skip to content

Conversation

@dush
Copy link
Contributor

@dush dush commented May 4, 2015

reversing array of strings is faster than reversing array of ActiveRecord models

- reversing array of strings is faster than reversing array of ActiveRecord models
@seuros
Copy link
Member

seuros commented May 4, 2015

Can you provide some benchmarks ?

@dush
Copy link
Contributor Author

dush commented May 4, 2015

https://gist.github.com/dush/599d2092205908848306

Calculating -------------------------------------
original ancestry_path 382.000 i/100ms
new ancestry_path 5.311k i/100ms


original ancestry_path 4.114k (± 5.6%) i/s - 20.628k
new ancestry_path 80.554k (± 5.3%) i/s - 403.636k

Comparison:
new ancestry_path: 80553.6 i/s
original ancestry_path: 4114.0 i/s - 19.58x slower

seuros added a commit that referenced this pull request May 5, 2015
faster ancestry_path method
@seuros seuros merged commit d34cbbf into ClosureTree:master May 5, 2015
@seuros
Copy link
Member

seuros commented May 5, 2015

Awesome.

@mceachen
Copy link
Collaborator

mceachen commented May 5, 2015 via email

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

Successfully merging this pull request may close these issues.

3 participants