Hi Przemek,

I forgot about one thing, in order to implement
__i18n_gettext() with hashes, two hash lookups
are needed, but my tests were doing only one.

Is there a way to eliminate two hash lookups
in this expression:

// IN: text, hash
IF text $ hash
   text := hash[ text ]
ENDIF
// OUT: text

I'm thinking of something like hb_HGet(), but
to return the original key (or a passed default)
if it's not found in the hash table (instead of
generating an RTE).

Brgds,
Viktor

On 2008.11.05., at 8:09, Szakáts Viktor wrote:

Hi Przemek,

Loading became more than twice as fast now,
a now just a bit (18%) slower than current
__i18n_loadfrommemory(). Perfect results for
such generic function.

                         r9830  r9838
__i18n_loadfrommemory():   3.72   3.72
__i18n_gettext():          3.39   3.33
hb_deserialize():         10.26   4.41
hash lookup:               2.58   4.16

For some reason simple hash lookup became
a bit slower, and now 30% slower than
__i18n_gettext() (previously it was 30%
faster). Still pretty good though. I wonder
what may cause this.

Brgds,
Viktor

On 2008.11.05., at 0:03, Przemyslaw Czerpak wrote:

On Tue, 04 Nov 2008, Szak�ts Viktor wrote:

Hi Viktor,

If you can implement the raw hash deserialization - besides
being great stuff by itself -, I think we will be able
to simply drop the current special i18n functions, since
we have everything we need using existing Harbour elements,
with similar or possibly better overall performance. The
only remaining part will be the "high-level" API, possibly
in .c, as we've discussed.

Please try current code. Hash deserialization should be noticeable
faster.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to