Sublime Forum

How many snippets file can I put into User folder?

#1

When I put more thant 10 million files within 400 folders. Sublime just cannot start. How many files can I put the most with16G RAM?

0 Likes

#2

I donā€™t have an answer to your question but I suspect youā€™re trying to use Sublime Text for something it isnā€™t designed for.
May I ask you why do you want to use 10 million snippet files? What are you trying to achive?

1 Like

#3

Just write some code snippets to save time.
500000 snippets can start but I want to know the upper bound.

0 Likes

#5

There is no hard upper bound, just however much your hardware is able to support and how long youā€™re willing to wait/how much youā€™re willing to deal with an unresponsive UI.

2 Likes

#6

Can I create many folders to save snippet to make sublime run more fast instead of put all in one folder?

0 Likes

#7

But seriously, why do you need that many snippets ? Thatā€™s excessive in the extreme.

1 Like

#8

Yes.More than that take too much RAM.Maybe need in the future.

0 Likes

#9

I want to know if I have 256GB RAM how many files can I save?

0 Likes

#10

Iā€™m not quite sure of the question youā€™re asking because ealier you say

and then youā€™re talking about 256GB of RAM:

but Iā€™ve just had a look at my snippets and they vary between 200 and 1000 bytes, so 0.2 to 1k. I donā€™t know how much space they take up in memory when theyā€™re loaded into Sublime, Iā€™m guessing theyā€™ll only be loaded as neccessary or perhaps thereā€™s some caching method going on, theyā€™re scoped too, which will reduce overheads.

If youā€™re talking about a 256Gig hard drive, well the answer is 5x256 x10ā¹ snippets max or 256x10ā¹ min. Should keep you going for a while. :smiley:

Even if all the snippets are loaded into memory and they take up 100 times more space in memory (as machine instructions) that still gives you 256x10ā· snippets. Obvs thereā€™s got to be room for ST3 and all your other processes, but the english language only contains 50k words, your average computer language (pulling a number out of the air) 100, 200. I think C has about 20 keywords. MindF*ck has two. But I digress. Iā€™m going to stick my neck out and say I think youā€™ll be fine for the first 6 months of ST use, after six months see how things are looking ?
:thinking: :star_struck:

Ps Sorry it was Brainf**k

1 Like

#11

Thank for reply.(The problem is trigger words.If trigger words less than 7 more than 1 with printable character,then the number of possible snippets is huge)
If I put more than about 1 million snippets(fix length ,all the same) . Then I cannot normal start sublime. (If I put 200000 snippets I can see task manage show sublime take much memory and CPU when it started,and then down later.)
I want to know If I add RAM space like from 16GB to 64GB and upgrade my CPU allow me to put more snippets and start sublime normally.And how much more can load?

0 Likes

#12

That, I have no idea about, Iā€™m just a user (and a noob at that)

But having said that, is the goal (of your question) to get a specific answer to your question?:
Or is this line of questioning trying to work out the performance of this editor vs other editors; so that you can decide which one you should use ?

If it is the latter; how do the other editors perfom when you run the same tests? If they perform better or worse, thereā€™s your answer as to which one you should use, if those are your circumstances/criteria you have to work with.

However if the reason for your question is the former, then everything Iā€™ve just said is totally useless, and hopefully someone else can jump in a save me/us :smiling_face_with_three_hearts:

Good luck L

Ps Just a final thought, I guess the folks at Sublime have designed it with some parameters in mind ie what is the upperbound for the amount of snippets the design team thought that someone might need. 200,000 snippets is a lot of snippetsā€¦

1 Like

#13

ā€¦Not require specific answerā€¦just want to know how to use more snippets.
Actually I havenā€™t use that much snippets.I wrote a program generate that much snippet templates for testing.So I have this question.

Other editors use different methods to create snippets(sublime is easy enough for me),maybe test later haā€¦

0 Likes

#14

Can you explain a little bit better why it is you need to have 10 million code snippets? You say ā€œto save timeā€, but Iā€™m having a hard time grasping how you could even remember 10 million different tab sequences to trigger the snippets in the first place. It seems like trying to narrow in on the correct one would take vastly more time than it would take to just enter the text you want in the first place.

2 Likes

#15

Just want to know the if thee is an answer.There maybe someone need in some time.

0 Likes

#16

https://packagecontrol.io/packages/Unity%20Completions has 209169 .sublime-snippets files in itā€¦ :joy:

1 Like

#17

So there maybe some occasions use that much snippets,like game develop.


0 Likes

#18

Maybe it is a filesystem I/O bottleneck? You should try to pack your snippets to zip-archive with .sublime-package extension, put it to the Installed Packages folder and look at any difference.

Also, if your snippets are just list of class/method names - you probably should try to generate completions (that can be in one file) instead of snippets.

1 Like

#19

Personally why I donā€™t use completions is (if Iā€™ve understood correctly) Iā€™ve got remember what I want in that file, and edit a long list where as with a snippet I can create one on the fly with a couple of keystrokes (now)ā€¦

1 Like

#20

The main issue would be that in order to be a part of the completion system, the contents of the files has to be loaded into memory, and since thereā€™s no artificially constrained upper bounds on the number memory is a finite resource, there is a finite number of them which can be defined before itā€™s no longer sustainable.

Regarding the differences between snippets and completions, thatā€™s summarized here:

Since both are meant to add items to the autocomplete panel to make common sequences or blocks of text easier to write, the idea that one would need so many of them that the limit is even something to worry about is a strong suggestion that someone is doing something wrong, all else being equal.

1 Like

#21

Just write some services for services quicker.

0 Likes