Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: better to delete skip list or nullify entries?
Topic Summary: better to delete skip list or nullify entries?
Created On: 6-Jun-2006 13:01
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Graham Stradling, on Thursday, June 8, 2006 2:47 PM

Answer:
I would tend to delete and re-create mainly because I tend to be very cautious when it comes to memory handling in DXL. My basic ethos is to delete anything I can when I can and keep the memory footprint as small as possible
 6-Jun-2006 13:01
User is offline View Users Profile Print this message


Heather Linsk

Posts: 50
Joined: 7-Mar-2006

I need to populate a skip list based on the results of a choice menu.

Is it better to delete the skip list and recreate it each time
or
set each entry to null and then repopulate?

TIA!!

-------------------------
Heather Linsk
Lead Engineer
General Dynamics AIS
413-494-7095
Report this to a Moderator Report this to a Moderator
 6-Jun-2006 13:28
User is offline View Users Profile Print this message


Graham Stradling

Posts: 67
Joined: 19-Sep-2002

Answer Answer
I would tend to delete and re-create mainly because I tend to be very cautious when it comes to memory handling in DXL. My basic ethos is to delete anything I can when I can and keep the memory footprint as small as possible

-------------------------
Graham Stradling,

Alcatel-Lucent.
Report this to a Moderator Report this to a Moderator
 6-Jun-2006 13:33
User is offline View Users Profile Print this message


Heather Linsk

Posts: 50
Joined: 7-Mar-2006

Does it make a difference if the skip list is a global variable and I am deleting and recreating it within a function?

-------------------------
Heather Linsk
Lead Engineer
General Dynamics AIS
413-494-7095
Report this to a Moderator Report this to a Moderator
 6-Jun-2006 20:48
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I don't see a difference whether its a global or local Skip. I'm not sure what you mean by "null" each entry. Perhaps you mean "delete" each entry. I'd be hesitant to have a Skip loop that deletes each entry:
for Data in skp do
{ Key = (string key skp)
delete(skp, Key)
}

You cannot do that with Links or Baselines since it screws up the outer loop, but maybe it would work for a Skip list. If this DOES work consistently it MAY have a performance improvement over a simple delete-and-create, but if it did it would take thousands of iterations to save any human-noticeable time.

Just delete and recreate it.

- Louie

PS. I DO see a noticeable improvement when dealing with Buffers: many of my functions declare a "global" buffer used only by that function. Buffer glBufAccess = create(). The first assignment to the buffer is with "=", subsequent use "+=". I DO see a big performance improvement over the natural method of declaring and creating the Buffer at the top of the function, and deleting it at the bottom. Yes, this method leaves the buffer in tact and taking up some memory, but that's not really very much memory.

I also see a DRASTIC imprment in declaring my Regular Expression globally, rather than in the function that uses it. The "RegExp re = regexp(etc)" construct seem to take an enourmous amount of time to interpret.
Report this to a Moderator Report this to a Moderator
 7-Jun-2006 18:06
User is offline View Users Profile Print this message


Shawn Stepper

Posts: 96
Joined: 6-Aug-2004

Louie,

Have you seen the same performance degradation with "matches" as with "regexp"?

Thanks,

Shawn

-------------------------
Shawn Stepper
shawn.e.stepper@wellsfargo.com
Report this to a Moderator Report this to a Moderator
 27-Jul-2007 12:07
User is offline View Users Profile Print this message


Peter Seager

Posts: 32
Joined: 10-Feb-2003

Turned this thread up looking for information about a similar problem.

I have a script with the following structure

Skip ListData // declare variable

Loop Until Done

create ListData // Creates an empty skiplist each pass of loop.

Do things to load skip list and use the data

Next Loop

delete ListData // Delete skip list after exiting loop.

Question is am I leaking memory or is the existing skip list just reconstructed each time? No problem with the script, that does what I want. I am sure I got the idea from some Telelogic script.

Edited: 27-Jul-2007 at 12:11 by Peter Seager
Report this to a Moderator Report this to a Moderator
 30-Jul-2007 21:10
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I have noticed that creating a regexp takes a huge amount of time. If you are checking 1000 requirements to see which contain 'shall' you'll notice an improvement in time if you define the regexp as global outside the function, rather inside the function:
Regexp reHasShall = regexp([S|s][H|h][A|a][L|l][L|l])
bool fHasShall(string Text)
{ return reHasShall Text)
}

- Louie
Report this to a Moderator Report this to a Moderator
 30-Jul-2007 21:43
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

A previous test showed that when you create the skip inside the loop after failing to delete it, the create appears to act as if it was created; specifically the old values are not in the Skip.

The attached code shows the dramatic difference between correctly deleting a skip inside the loop that creates it, compared to waiting until after the loop. It takes zero seconds to complete when you confirm delete inside the skip, but takes 60 seconds if you do not confirm.

Conclusion: delete Skips (et tal) in the same context that you create them.

- Louie

PS. The delay appears to be somewhat exponecial; 60 seconds for 50,000 loops but 250 for 100,000.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.