Sublime Forum

Large C++ file loading performance in recent ST3 betas

#21

In both of the spindumps, all the time is being spent in malloc/free, which is used by sregex when handling lookahead assertions. My hunch is that something is happening on your system that is making malloc much slower than usual. Perhaps you have one of the environment variables turned on that enables malloc debugging on OSX?

In any case, I’ll reduce the number of malloc/free calls in this path for the next build. It’ll give a small speedup in the general case, but may give a significant speedup for you.

1 Like

#23

Thank you, that might be the case, I will double check my memory debug settings on that machine tomorrow and reply again with my finding.

0 Likes

#24

I cannot find any. Is there a way to ask Sublime Text to print out all the currently used environment variables?

0 Likes

#25

By the way, you can also try reproducing this with latest build of macOS 10.12 Sierra, that’s what I’m running.

0 Likes

#26

You can run import os, then os.environ in the console, which will print out plugin_hosts environment, which it should inherit from the Sublime Text process.

Let me know if this issue is still happening in 3123, as malloc is no longer used for lookahead assertions in sregex.

0 Likes

#27

Thanks a lot of the help. It seems that is has indeed gotten much better, I have been running the new build for hours and haven’t noticed the lag yet. Reloading the files on startup is still slower than 3109 but not as bad as previous builds from 3110.

0 Likes