Subject: [LON-CAPA-dev] caching

From: "Matthew Brian Hall" <[email-masked]>
Date: Wed, 5 Mar 2003 09:31:36 -0500 (EST)

At the meeting I mentioned the ineffectiveness of the caching mechanism
we were using.  The scheme was to have one file for each course and that
would hold all the data for all the students.  The new scheme is to have
one file per student.  Here are some of the numbers from the test:

These statistics are from a class with 400 students and about 150 out of 240
homework problems having been completed.

         Initial storage and chart computation        Redisplay (use cache)
old:       272 sec                                      580
new:       202 sec                                       20

It looks like this new method is the way to go :)

Matthew

--
------------------------------------------------------------------
Matthew Hall           LON-CAPA developer         [email-masked]
123 North Kedzie Hall                    Michigan State University
------------------------------------------------------------------

---

From: "H. K. Ng" <[email-masked]>
Date: Thu, 06 Mar 2003 10:58:04 -0500

When retrieving the parts using parts->$curRes->parts(), it appears that if 
it goes to the same httpd, it remembers that list that was there, i.e., 
instead of getting, say, 2 parts, it list 4 parts - a duplicate.
Questions:
1. How do I reset the call so that it give the correct number of parts? I 
tried $navmap->init();

2. I recalled that there is a way to have only one (child process) httpd 
running. Can anyone tell me how that is done?

Thanks,
hk

---

From: Jeremy Bowers <[email-masked]>
Date: Thu, 06 Mar 2003 11:11:51 -0500

H. K. Ng wrote:
> When retrieving the parts using parts->$curRes->parts(), it appears that 
> if it goes to the same httpd, it remembers that list that was there, 
> i.e., instead of getting, say, 2 parts, it list 4 parts - a duplicate.

That's not supposed to happen. It is supposed to remember the parts so 
it doesn't have to re-compute them.

Try changing

     return if ($self->{PARTS});

to

     return if (defined($self->{PARTS}));

on line 2705 of lonnavmaps.pm and see if that fixes it.

> Questions:
> 1. How do I reset the call so that it give the correct number of parts? 
> I tried $navmap->init();

This isn't supposed to be necessary, so there isn't a way. If you want, 
deleting the {PARTS} member of the resource object will reset the parts, 
but that's only to let you continue developing while I/we fix the 
problem; you should not normally do that and you need to take that out 
before the end.

> running. Can anyone tell me how that is done?

-X on the Apache call, but that is not related to this. The nav maps 
routines do not make sub-calls within Apache, it is all done within one 
child, as confirmed by the fact that nav maps still work when -X is used.

---

From: "H. K. Ng" <[email-masked]>
Date: Fri, 07 Mar 2003 09:57:26 -0500

>on line 2705 of lonnavmaps.pm and see if that fixes it.

Changing to return if (defined($self-... seems to fix it. I did a cvs 
update before changing and it is on line 2694, not 2705?? Just to check, 
the statement is within the extractParts subroutine. Jeremy, I will let you 
make the changes and commit to cvs. - hk

---

From: Jeremy Bowers <[email-masked]>
Date: Fri, 07 Mar 2003 10:28:39 -0500

H. K. Ng wrote:
> the statement is within the extractParts subroutine. Jeremy, I will let 
> you make the changes and commit to cvs. - hk

I'm glad that worked and I will commit it.

As for the line number, I had been working on a navmap bug (not related 
to the iterator) so yes, it was a few off. I should have cvs diff'ed, or 
said it might not be exact. Sorry!

---

From: "H. K. Ng" <[email-masked]>
Date: Thu, 13 Mar 2003 16:30:14 -0500

I just did a cvs update and lonnavmaps seems to be broken. Some of the 
messages in error.log:

Thu Mar 13 16:23:02 2003] [error] Can't call method "firstResource" on an 
undefined value at /home/httpd/lib/perl/Apache/grades.pm line 2451.

When I comment that line out, it gives

[Thu Mar 13 16:27:01 2003] [error] Can't call method "init" on an undefined 
value at /home/httpd/lib/perl/Apache/grades.pm line 2452.

and it just keeps going.
-hk

also, the parts problem is back!!

---

From: Guy Albertelli II <[email-masked]>
Date: Thu, 13 Mar 2003 16:58:31 -0500 (EST)

Hi Hon-Kie,

The currently committed grades.pm and lonnavmaps.pm seem to be working
fine.

Could you do a commit of you current grades.pm ?

> undefined value at /home/httpd/lib/perl/Apache/grades.pm line 2451.

This sounds like the  my $navmap = Apache::lonnavmaps::navmap->new(blahblah);

is returning an undefined value, Can you check what you are passing to
it is correct? 

-- 
[email-masked]  LON-CAPA Developer  0-7-7-4-