We’ve In-Line Javascript data like following with thousand of lines.
I’ve observed that it is taking lot of memory too, this is a problem in mobile browsers.
Does it help to move this code to some JSON File, and parsing it.
I just want this code to GCed as soon as it is executed.
db.transaction(function(tx) {
transaction.executeSql("INSERT INTO TABLE VALUES(111,'xxx','2012-11-09 18:48:12')");
..... Another 10K Lines of above String .............
}
With about 10k of those lines, you have about half a MB of raw text going through your js, not to mention the fact that you’re calling
transaction.executeSql()about 10k times.You could reduce that a bit by combining multiple (/all)
INSERT INTOstatements into a single statement: