gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Dirname caching for leroy's tla on cygwin


From: John Meinel
Subject: Re: [Gnu-arch-users] Dirname caching for leroy's tla on cygwin
Date: Mon, 05 Jul 2004 10:08:04 -0500
User-agent: Mozilla Thunderbird 0.7 (Windows/20040616)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well, it's arguable how "easy" things are. :) If this was C++, I would
already have a map<string, string> class. Internally it uses a RedBlack
binary tree. So it would have been fast for lookups. But alas, I'm not
really sure how to implement it. But I don't expect it will be terrible.

Anyway, did you release this anywhere? I can play around with creating a
binary string->string tree, and getting the functions running with caching.

John
=:->

address@hidden wrote:

|>Also, are you smart about the name, such that if I have the directory
|>hello-world--mainline
|>and one
|>hello-world--dev
|>One of these will get
|>HELLO-~1
|>And the other
|>HELLO-~2
|>Depending on which was created first, etc.
|
|
| Yes, I'm pretty smart about those name :-), I leave it up to
| Microsoft to determine them...!
|
| Now, all of this has simplified the code a lot!
|
|
| What's left to do is caching.
|
| It is *very* easy to implement, but I do not realy have the time
| just now.
|
| There is 2 functions to add caching to:
|
| /* NO CACHING */
| char* pathcompress_uncompress_path(char* path, char* uncompressed) {
|   return pathcompress_process_path(path, NULL, uncompressed);
| }
|
| /* WITH CACHING */
| char* pathcompress_uncompress_path(char* path, char* uncompressed) {
|   char* tmp = pathcompress_lookup_uncompressed(path);
|   if (tmp != NULL) {
|     strcpy(uncompressed, tmp);
|     return uncompressed;
|   }
|   tmp = pathcompress_process_path(path, NULL, uncompressed);
|   pathcompress_add_uncompressed(path, tmp);
|   return tmp;
| }
|
| and implement lookup and add as efficiently as possible.
|
| -- lode
|
|
|
- ----------------------------------------------------------------------------------
| Plaats je zoekertjes GRATIS op AdValvas
| Placez votre petite annonce GRATUITEMENT sur AdValvas
| http://www.advalvas.be
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA6W7UJdeBCYSNAAMRAh4YAKCzwSgUcQecUCeNmDOlxqQsMdA+SwCeNrNo
l78RNagENGz53Av2+3+J4cI=
=cC9b
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]