string performance

Klacke <>
Mon Sep 20 16:27:29 CEST 1999




 > In many ways, Erlang looks very good for building distributed
 > web applications, but its string performance is very poor in my
 > benchmarks: string append is orders of magnitude slower than
 > in Perl, and characters take many bytes to store (compared to one
 > byte per character in other languages).
 > 
 > I'm curious whether there are any plans to address this.
 > One approach would be to transparently switch representations
 > between lists and strings, like Tcl does.  That would be 
 > completely backwards compatible.  An alternative would be to
 > define a separate string type, define new pattern matching
 > syntax for true strings or prohibit pattern matching on true
 > strings altogether; this would be backwards compatible, but less
 > interopreable between old and new code (I still prefer this latter
 > choice).
 > 
 > So, what are the plans?  I know I can use byte arrays, but that
 > doesn't seem like it's quite the same as having a real string type.


The last thing I did while I was still at Ericsson was an 
ambitios atempt do address not only the string issue but a number of other
related buffer management issues together with Tony Rogvall.

We worked with it for almost a year and the end result was
a working implementation and a report.

The implementation was never released neither as open source nor
internally in ericsson other than to our colleagues.
The results from the prototype were quite promising though,
both in regards to execution efficency as well as clarity of the
code.


A report describing the proposed language extensions is available at: 

http://www.bluetail.com/klacke/binaries.ps 

and I'll be
presenting this at the Erlang user conf which is due real soon now.

Now, this work was a prototype and it would need quite a 
lot of work to implement it properly and I have no idea what 
plans the OTP group have. Furthermore, the implementation 
was jam specific and I know the OTP group are going for the BEAM 
machine instead. 

/klacke


Claes Wikström                          Tel: +46 (0)8 692 22 09
Bluetail AB                             Email: 
Hantverkargatan 78                      WWW: http://www.bluetail.com
SE-112 38 Stockholm, SWEDEN







More information about the erlang-questions mailing list