in reply to Re^4: Undefined vs empty string
in thread Undefined vs empty string
Speed very much depends on what is the most likely value to occur in the tests. length for sure is not always faster.
Hm. You seem to be implying that the speed of length varies with the length of the string?
Whilst that would make sense with C; it makes no sense at all with length, which doesn't need to scan the string to find its length.
Which makes me a little suspicious of the benchmark.
Update: Of course; the affect you are seeing it due to stringification of numeric values.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Undefined vs empty string
by Tux (Canon) on Jun 05, 2013 at 11:21 UTC | |
by BrowserUk (Patriarch) on Jun 05, 2013 at 11:57 UTC | |
by Tux (Canon) on Jun 05, 2013 at 12:32 UTC | |
by BrowserUk (Patriarch) on Jun 05, 2013 at 13:06 UTC | |
|
Re^6: Undefined vs empty string
by ikegami (Patriarch) on Jun 05, 2013 at 20:00 UTC | |
by BrowserUk (Patriarch) on Jun 05, 2013 at 20:33 UTC |