This project is archived and is in readonly mode.
reduce usage of Pathname to make things faster
Reported by Neeraj Singh | June 24th, 2010 @ 01:30 PM | in 3.x
following the footsteps of this commit http://github.com/rails/rails/commit/69abbe893413c99808c8cebd2f1d46...
Comments and changes to this ticket
-
Neeraj Singh June 24th, 2010 @ 04:25 PM
- Tag changed from rails3 to patch, rails3
- Assigned user set to José Valim
Attached is code patch.
-
Jason Gignac June 24th, 2010 @ 04:51 PM
I am only curious, but why is pathname slower than the alternative implementation that is in the original commit and that you suggest in your diff here?
-
José Valim June 24th, 2010 @ 04:55 PM
Jason, doing operations in Pathname objects is expensive. If you run some benchmarks, you can see the difference!
-
José Valim June 24th, 2010 @ 07:15 PM
- State changed from new to invalid
Neeraj, in this case it would be better if the method returned a pathname object for both windows and other platforms, for consistency. And your patch breaks that, so I cannot apply it. :(
I think there is no reason to worry with remaining Pathnames in Rails though, the ones that were appearing in profiling and benchmarks were already removed! Thanks!
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>