How to efficiently color a polymesh

You right @MSP_Greg. This was supposed to be a temporary simple solution. Not so sure about the ‘simple’ anymore though :smile:

Well I run Linux ( debian style Ubuntu 15.10 64bit ) and I put Virtual Box in and then add windows 7-1 to run the Sketchup in
Try adding Virtual Box and then add the windows stuff to it then add the sketch up
But then I have 16 gig of DDR 3 ram to play in !

@MSP_Greg, @Rojj, @tt_su

I just tested it on v15 El Capitan and got this with the mat window closed…
Material Window Closed
Faces & Materials Count = 3000 Materials Time = 9.891 Faces Time = 0.084 -------------------------------
Material Window Open - set to Thumbnails
it didn’t complete
memory went up to 2.5GB before I did a force quit…

john

The .zip method is creating unneeded nested array instances. *

Object creation always takes time. You can see this if you re-create local references inside the loop, as opposed to creating them once before the loop, and just reassigning to them within the loop.

(* You have since stopped using .zip, but this comment was moved back to this thread from another one.)

A footnote to Dan’s observation: if you create a lot of objects, you put pressure on the memory management that can trigger it to do garbage collection to free up “dead” objects. Garbage collection can have a major impact on performance.

Interesting but my immediate question is: what is best practice if you do need to create a lot of objects - lets say copy a lot of edges or components a few hundred/thousand times? Do it in batches and explode every X objects?

1 Like

@slbaumgartner
Steve, did you try the code with activity monitor and ‘Colors’ open?

memory usage really ramps up, and is not cleared after the undo and then purging the materials…

you actually need to restart for it to be released…

john

That’s not surprising. Most apps do not give back memory they have allocated until they exit. That’s a different question from how they manage the use of the memory they have allocated - i.e. object creation and garbage collection - neither of which necessarily implies allocation or release of memory from the OS. Unless it is done carefully, getting more memory from the OS can be a slow operation.