Re: Best way to store postfix data?



I agree with you. In fact, I have a tree based logic that is quite
fast (can read, parse, error check, and execute complex statements
with control logic in the same time as the old read one line, execute
one line (only simplest statements) engine.

But unfortunately, my boss wants me to try this approach and then
compare them. I haven't optimized my tree approach (at the moment, it
is a memory hog. 20,000 lines of code was spiking it from ~15mbs usage
to ~60 mbs usage. There's some obvious things I can remove to drop
that to ~40mbs, but there's some memory hog I've missed in there.
Probably my method for building my assign logic. It's fast, but it's
creating objects for each element of an assign statement. Very fast,
but inefficient. As for any memory fragmentation, I could use
CFixedAlloc at the cost of slightly higher memory cost requirements,
but I'm willing to try other solutions.

The reason for the two maps is fairly simple. As I'm building the
logic, it CAN grow. As of right now, my 'instructions' are the same
size if I can move the logic and assignments to virtual 'heap' space.
To me, that seems infinitely preferable to trying to store them inline
and recording the size of the block. Maybe not. Storing references
to variables is no longer an issue, as we're going to be saving the
files so that if the saved preprocessed version and the file share the
same timestamp, we just load the preprocessed. This means I can't
store the variable locations.

I was storing the assignment logic as a string, not the variables.
Those are already in the engine. Instead, I'm trying to come up with
the most efficient way of taking these instructions in, and storing
them. Since I allow control routines, I have to execute at runtime,
and hence, have to build a logic for the program. Post-fix notation
seems like it would help a lot here, as I have both single arguement
functions and double arguement functions. Since I can't guarantee
that the variable addresses will stay the same between runs, I don't
think I can store them (also, erm, they aren't simple variables. I
can't create a simple reference to it. It's an inherited problem from
code written 15 years ago.).

In short, I'm not trying to store the symbol table as strings, just my
assignment statements. Variables are stored entirely separate from
the engine, and I can not change that.

An efficient way of doing this interpretation is just stumping me. I
definately appreciate your help, and I'll be happy to answer any
questions you have or try anything you suggest. Unfortunately, I'm
only an intern, with less than a year of c++ experience (though I've
been coding for much longer than that), so I might come up with some
truly monumentally odd ways of solving things. I'm not opposed to
learning new things. Thanks for the help.

.



Relevant Pages

  • Re: Best way to store postfix data?
    ... Look into based pointers. ... with control logic in the same time as the old read one line, execute ... but there's some memory hog I've missed in there. ... that seems infinitely preferable to trying to store them inline ...
    (microsoft.public.vc.mfc)
  • Re: Controling Event Sequencing...
    ... the framework will post a message to the message queue ... does not execute after the event is fired.... ... control exposes this event to the programmer to allow him / her to ... these system / control events will immidiately fire after the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: More Before-The-Fact-Isms II, blocking viruses and spyware through NTFS
    ... > BUILTIN\Administrators Full Control ... > BUILTIN\CREATOR OWNER Special (Full Control except Execute) for Files ... but still can't launch any executables. ...
    (microsoft.public.security)
  • Re: Controling Event Sequencing...
    ... need the OnPostClick event fire after the OnClick event is completely ... event queue and have it execute AFTER the OnClick in completely done ... ... control exposes this event to the programmer to allow him / her to ... I inherit from this and create another button... ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Javascript Server-side Action Questions..
    ... How do you set the values from server-side to a client-side ... control or how do you execute a javascript function without a button click ... What ever asp.net control post back to your server even handler add ... there you can write your checkbox selection logic. ...
    (microsoft.public.dotnet.framework.aspnet)

Loading