Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

reduce usage of Pathname to make things faster

#4955

Reported by Neeraj Singh · June 24th, 2010 @ 01:30 PM

State: invalid
Milestone: 3.x
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Neeraj Singh
    Neeraj Singh
    • Tag changed from rails3 to patch, rails3
    • Assigned user set to José Valim

    Attached is code patch.

    June 24th, 2010 @ 04:25 PM

  2. Jason Gignac
    Jason Gignac

    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?

    June 24th, 2010 @ 04:51 PM

  3. José Valim
    José Valim

    Jason, doing operations in Pathname objects is expensive. If you run some benchmarks, you can see the difference!

    June 24th, 2010 @ 04:55 PM

  4. José Valim
    José Valim
    • 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!

    June 24th, 2010 @ 07:15 PM