![]() ![]() In addition, this benchmark only gives an indication of raw speed other factors like memory usage are also important to consider. Please note tests were carried out on only a single test string (with both leading and trailing characters that needed trimming). For example, the following string variable, which we will cut to a. | Spread Version (Robin F.) | 4242.8 Ops/sec | Cutting a string to a specified length is accomplished with the substr() function. ![]() | Boolean Filter Version (mbaer3000)| 94162.3 Ops/sec | | Index Version (Jason Larke) | 949979.7 Ops/sec | Some interesting and unexpected results running under Chrome. Update: Was curious around the performance of different solutions and so I've updated a basic benchmark here: To do this, MightyPork suggests to replace the ifs with the following line of code: c = c.replace(/]/g, '\\$
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |