[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Suggestion : Use unique string type instead of two (short and long)
- From: 云风 <cloudwu@...>
- Date: Mon, 17 Jun 2019 22:18:45 +0800
>
> I disagree that the parser stage is going to be the main source of string objects in general. Almost any program that has to read data from a file is going to use a lot of small strings. (It is, of course, possible to do it with a single long string and then only process it using numeric data types, but that technique only makes sense for packed binary data.)
>
A cache in GC can merge most of the same strings. When we mark a string to black , put it into the cache or merge to the previous one.
The cache can be fixed size, so it can immune the hash dos attack .