⚡ Reduce gcode viewer memory usage when loading file
This commit is contained in:
1 parent
80ccde6ee2
commit
4735cd195b
1 file changed
+2
-1
@@ -154,7 +154,8 @@ GCODE.gCodeReader = (function () {
|
||||
this.clear();
|
||||
|
||||
var totalSize = reader.target.result.length;
|
||||
lines = reader.target.result.split(/[\r\n]/g);
|
||||
// With a regex split below as previous, memory usage is huge & takes longer.
|
||||
lines = reader.target.result.replace("\r\n", "\n").split("\n");
|
||||
reader.target.result = null;
|
||||
prepareGCode(totalSize);
|
||||
|
||||
|
||||
Reference in new issue
Block a user