The bad times are past times now at the Anacostia branch of the D.C. Public Library. There's more money for books, so librarian Margaret Kemp just updated her health and cooking titles. There's more for upkeep, so lighting is better and the wall paint new. And hours, which sank to 40 a week, are now 55.

Still, Kemp has no money to freshen her fading literature, art and history collections, none for a subscription to the New York Times. The branch is still closed four nights a week. Street people take over tables and, well, "sometimes the odor leaves something to be desired," she said.

And neighborhood residents barely dip into Anacostia's riches. They checked out its 39,853 books an average of less than once apiece last year, far below the norm for big-city libraries.

As Anacostia has gone, so has the D.C. Public Library system.

It is a city service that, at first glance, has been rejuvenated, with longer hours, better maintenance and bigger outlays for reading materials. In a poll conducted for The Washington Post, 70 percent of 1,505 residents said the library was doing a good or an excellent job, and only 1 percent said poor, one of the best ratings of any District service.

But a legacy of lean years lingers. Book budgets, while larger, are still stretched. Understaffing remains, and some roofs still drip. Although hours of operation are longer, they have never regained the old levels, but problems with the homeless and the troubled have reached new ones.

"We're beginning to recover from years of budget reductions, but we still have a long way to go," said Library Director Hardy R. Franklin.

And whatever warm feelings residents have toward the library in theory, most largely ignore it in practice. Invited to tap a free service as often as they like, 18 percent said they or someone from their family do so very often. But nearly three of every five, 58 percent, said they never go or go infrequently.

The Post visited the Martin Luther King main library downtown and half of the 25 branches; reviewed budget documents and circulation data; and interviewed residents, librarians and administrators.

What emerged was a system that engenders goodwill. A D.C. Council committee said earlier this year it was "confident that every penny appropriated to the Library . . . will be tax dollars well spent." Many branch librarians said they can match service in the suburbs, while patrons praised the courtesy and knowledge of library staff.

"When I look at other branches of city government," said Palisades resident Dana G. Dalrymple, who has been an activist on behalf of libraries, "one is extremely happy."

Yet the library system is a reduced priority for the administration of Mayor Marion Barry and the D.C. Council. Once, its budget was 1.1 percent of city spending. Now, it is 0.6 percent, even with recent boosts. It is an adjustment that national experts said many cities have made as they confront more urgent issues, such as drugs or homelessness.

The shift has left the library echoing the complaints of many District agencies: too little staff, too little cash. It is unclear, however, if that is why most residents choose not to fully exploit a city service that will cost them $18.9 million this year and that is literally begging to be exploited.

Actually, circulation -- the pulse of a library -- has risen steadily since 1979 and stood at just under 2 million books last fiscal year, with dramatic gains in some of the city's poorer sections. "We're getting more readers," said Joe Ann Ellis, adult librarian at the Benning branch in Northeast. "I've detected a change in our neighborhood here."

But the number of books checked out each year per resident, 3.1, remains lower than most cities the District's size, according to the Chicago-based Public Library Association. The average for libraries in cities with 500,000 to a million residents -- the District has 628,000 -- is 6.4 books per resident every year. Even when limited to residents who have library cards, the District's circulation rate is low.

"I guess I'm unusual," said Vincent Waller, 25, a paint company worker who was thumbing through a magazine at the Cleveland Park branch. "Most of my circle of friends don't use it. They think it's boring." The Library Habit

Franklin, the library's director since 1974, suggested that many District residents are not library addicts because of segregation. Franklin, who is black, said blacks were often excluded from public libraries in the South and, as many moved North, had no library habit to bring along. That could depress the system's circulation, because the city is 70 percent black, he said.

"We have to work real hard at getting the word out about {our} libraries," said Deputy Director Lawrence E. Molumby. "I've been with the library 20 years, and the complaint I've heard the most over those 20 years is, 'Why didn't we know that you did thus and so?' "

The library, however, has not budgeted a single dollar for promotion. It says it has none to spare. Beyond that, it spends an unusually low percentage of its money on an item many library experts say is crucial to luring people inside: books.

Patrons crave Danielle Steel's latest novel, librarians say, or the most recent guide to France. "If you can't buy it this year, when people need it, you've failed the people," said Eleanor Jo Rodger, executive director of the Public Library Association.

In the last two decades, as the District's book budget rose 227 percent, book prices climbed 400 percent and the cost of periodicals 979 percent, according to industry figures. Since 1982, the book budget has gained back some of that lost ground and now stands at $2 million of the library's $18.9 million overall budget. Branch librarians, who each get a chunk of the book money to make their own selections, said they feel less strapped.

"What I want, they have," said Bob Wilson, a retiree who said he visits the Petworth branch almost every day. "They carry just about everything current. Yeah, I'm very well satisfied."

Overall, though, the $2 million book budget is just 9.5 percent of the library budget, with the rest of the money going to salaries, upkeep and other needs. Most libraries elsewhere spend an average of 15 percent of their money on books.

"If you start spending under 10 percent for books, the function of your libraries then becomes not library service, but municipal employment," said Charles Robinson, director of the Baltimore County Public Library.

Molumby said comparisons are unfair because the D.C. library system is forced to pay its own utility and security bills, items that some city governments pay on behalf of their libraries. That depresses the percentage of the budget going for books, he said. And money alone might not be the answer: Some library systems that spend a greater percentage on books than the District do not wind up with better circulation rates.

Even so, Molumby and Franklin said, more of the library budget should go to books. Molumby said he would like the mayor and council to provide $750,000 more annually. That would buy 17,800 books at the hardcover average of $42.11, a figure inflated by specialty titles.

Given the city's fiscal problems, such an increase seems unlikely, even though the D.C. Council's committee on libraries did say in March, "Funding for the most important aspect of the Library remains inadequate."

As it now stands, the book fund means that, at Benning, Ellis cannot offer GQ, Vogue or Popular Science. Patrons at the Northeast branch on Capitol Hill won't find the Wall Street Journal. Record album collections are aging, and apparently only the Cleveland Park branch has a compact disc collection.

"I don't see or sense a tremendous amount of up-to-date books, modern books," said John Holzwart, a D.C. police officer who told The Post's poll that he rarely goes to the library. Stretching Collections

Several librarians said that almost every day, patrons ask for books they don't have, which means they must be delivered from the main branch or the patron must travel downtown. That's what will happen if patrons at the West End branch at 24th and L streets Northwest ask for Michael Underwood's new novel, "Rosa's Dilemma."

Early last month, librarian Diane Mohr went to Room 417 of the main library to choose from advance copies of new titles. Her patrons liked earlier Underwood, she said, but given "Rosa's" poor reviews and $15.95 price, she declined it. She just didn't want to spend the money.

Librarians said they also wish they had more staff. In 1970, the library had 561 authorized positions. But for fiscal reasons, the total has been cut to 475 even as the library opened two new full branches and expanded other service. That has meant shorter hours, officials said, because there is not enough staff for two shifts. Branches were open until 9 p.m. six days a week in 1970 -- 72 hours of weekly service, except in summer -- but they can be staffed only two nights now.

There is disagreement about whether that has hurt circulation. Nelson Cuellar, adult librarian at Capitol Hill's Southeast branch, senses little demand for evening service. But Gail Avery at Chevy Chase said, "It is really hard sometimes to clear this branch at 5:30."

Among the positions eliminated over the years were pages, who sort and shelve returned books. Some librarians said that, as a result, they must help now with reshelving. That, as well as other demands, means they have less time to develop programs to boost circulation and less time for forays to promote the library, some said.

Pages were not cut, though, at Martin Luther King, the busiest branch of the system, accounting for 24 percent of circulation. Books checked out at any other branch can be returned there. The pages reshelve the books that belong to King and redistribute those that belong to the branches.

But turnover among the pages was 167 percent last year, and officials said it often takes two days to reshelve a book. Librarian Mohr, who once worked at King, said "critical backlogs" develop and the delay is often as long as two weeks.

That means patrons often cannot find a book that the system's computer says is available, which might discourage them from using the D.C. library. For example, The Post checked 19 titles, and the computer said 77 copies of those titles were on the shelves. A check of the shelves, however, found that 45 of the 77 copies were not there.

Staffing also has become an issue in regard to security and street people. As residents, library officials said, the homeless and troubled have the same right to sit in a library as anyone. But librarians said they often disrupt, sometimes by yelling, sometimes merely by their lack of hygiene.

"Some lady told me the other day, 'I think you have a sewer problem in here,' " said Helen Delaney, librarian at Cleveland Park.

At Anacostia, said Kemp, one man routinely knocks books off shelves. At the Northeast branch on Capitol Hill, librarian Alfred Maury said he has broken up fights, and his colleague, Ellen Kardy, said a man once exposed himself to her. The problem appears to be worst at King, where security guards quelled 228 incidents last year, up from 81 in 1986.

"They've brought the same habits that they utilize outside the library, defecating in the library, urinating anyplace," said Franklin.

Some branch librarians said they would welcome full-time guards. But Franklin said that, until there is more money, librarians are a higher priority. When problems do arise at branches, guards are dispatched from King, where 22 are based.