Measuring/improving performance

From: Andrew Joseph Kompanek <ak10+_at_andrew.cmu.edu>
Date: Wed, 12 Apr 1995 13:12:43 -0400 (EDT)

I've written a parser that interprets a simple text-based distributed object
protocol (it simply supports sending objects and their attribute values)
and turns it into scheme/stklos data structures.

It ends up being horrendously slow -- something like a list only about
50 simple objects a second.

It has two layers:

  - a simple tokenizer: the tokens are just delimiters and strings
    of characters separated by whitespace. I use read-char and
    peek-char and a simple case to convert a character into
    a symbol standing for a delimiter.

  - a simple parser: when the expression parser recognizes a delimiter
    it calls the associated parser for the expression type.

I'm not sure if this is enough information -- but I'm trying to decide
how to go about profiling where the program is spending its time and
then figure out if there's anything I can do to speed things up,
including implementing parts in C. I suspect that it spends most
of its time manipulating data structures... which makes me think
that implementing control and I/O in C wouldn't speed things
up significantly.

The code is quite simple... it's EXTREMELY distressing that it's
as slow as it is -- basically unacceptable for the application
I'm working on.

Any help would really, really appreciated -- anything about profiling,
advice on places to look for bottlenecks, how much of a speed
gain you can get doing different things in C, etc...

Thanks,
Drew
Received on Wed Apr 12 1995 - 19:15:21 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST