[SERVER-8723] String.prototype.endsWith performance increase Created: 25/Feb/13 Updated: 10/Dec/14 Resolved: 22/Apr/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | JavaScript, Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | saml | Assignee: | Andrew Emil (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Participants: |
| Description |
|
String.prototype.endsWith() uses unnecessary RegExp and affects performance.
newEndsWith.js
endsWithTest.js
|
| Comments |
| Comment by Andrew Emil (Inactive) [ 15/Apr/13 ] |
|
Hey SamL, I was going looking over this ticket, let me know or respond here if you would like to submit some tests or changes for this pull request. I will check back next week and, if there is no activity, close it out. |
| Comment by Andrew Emil (Inactive) [ 13/Mar/13 ] |
|
Using the file I uploaded to test this change, it seems that we do not get a performance increase using lastIndexOf instead of regular expressions. Here is the output when I run endWithTest2.js $ mongo endWithTest2.js Based on these results I would say that this change should not go forward. |
| Comment by Andrew Emil (Inactive) [ 13/Mar/13 ] |
|
File to test request (credit to Ben Becker) |
| Comment by Daniel Pasette (Inactive) [ 26/Feb/13 ] |