Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
4990eb42
Commit
4990eb42
authored
Apr 03, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try reducing peak memory usage
parent
83c49a7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
actors.py
printrun/gl/libtatlin/actors.py
+11
-6
No files found.
printrun/gl/libtatlin/actors.py
View file @
4990eb42
...
...
@@ -406,15 +406,18 @@ class GcodeModel(Model):
twopi
=
2
*
math
.
pi
processed_lines
=
0
while
layer_idx
<
len
(
model_data
.
all_layers
):
with
self
.
lock
:
nlines
=
len
(
model_data
)
ntravelcoords
=
travel_coords_count
(
nlines
)
ncoords
=
coords_count
(
nlines
)
nindices
=
indices_count
(
nlines
)
# TODO: only reallocate memory if needed
# compute ncoords(nlines-lines_processed)+vertex_k
if
ncoords
!=
vertices
.
size
:
remaining_lines
=
nlines
-
processed_lines
# Only reallocate memory which might be needed, not memory
# for everything
ntravelcoords
=
coords_count
(
remaining_lines
)
+
travel_vertex_k
ncoords
=
coords_count
(
remaining_lines
)
+
vertex_k
nindices
=
indices_count
(
remaining_lines
)
+
index_k
if
ncoords
>
vertices
.
size
:
self
.
travels
.
resize
(
ntravelcoords
,
refcheck
=
False
)
self
.
vertices
.
resize
(
ncoords
,
refcheck
=
False
)
self
.
colors
.
resize
(
ncoords
,
refcheck
=
False
)
...
...
@@ -614,6 +617,8 @@ class GcodeModel(Model):
self
.
initialized
=
False
self
.
loaded
=
True
processed_lines
+=
len
(
layer
)
if
callback
:
callback
(
layer_idx
+
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment