Since you need to give IO an overhaul for system work  my old pet ...
-  New Fast Strings based on UTF8 .. ( note you need to convert all UTF16
CLR constant strings to fast strings at load)
- Fast strings have a bit in indicating ASCII , which can be set on
construction or on first time indexed
- Fast strings are indexable if its known ASCII ,  if not known via SIMD
bitscan  of 0x10 ( which may then set the ascii bit )   .
- chars stay as per runtime 16 bit when  changing or reading an ASCII
string then the high byte is ignored.
- Fast strings can be mutable or imutable  .  Most users would use
immutable strings but single threaded code  is free  to use the mutable
version ( note for mutable strings length will not change)
 - New string.format  options var formstring =  " format string {0....}
 other firelds {1....} , where the . and braces are exactly replaced by the
paramaters with no instantiation of new strings. ( note you need a internal
format  string with empties and param offsets but its constant data  so can
be done once ..  Obviously you can reuse the format string and  empty teh
value space each time or just copy  the internal format string  depensing
on need.
- use SIMD UTF8, UTF16 and Ascii conversion ,  ( can do about 1600 chars
per micro second) , external c lib  unless the CLR can do it via  new
intrinsics..

Why ? The fact that 90% of strings are 0X00 0x??  0x00 0x?? etc seems
monumentally wastefull even for foreign languages ..

Pretty much 60% of the data moved around or compared for most string
operations is a huge win over C# and Java  . Most web sites are UTF8-ASCII
and even foreign web sites are 80-90% ASCII .
Think middle tier performance json , xml  etc etc , Maybe enough to lift
mono over those products.

It would be nice if immutable shallow types are interred in the special
heap where the  mark doesnt scan like strings but i doubt thats possible.
 Also the above is not possible in safe C# ( because of the fixed array)

Ben
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to