Função aSort() refeita, agora mais veloz.

Projeto [x]Harbour - Compilador de código aberto compatível com o Clipper.

Moderador: Moderadores

Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7929
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Função aSort() refeita, agora mais veloz.

Mensagem por Itamar M. Lins Jr. »

Ola!

Código: Selecionar todos

2015-07-31 16:01 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
  * src/vm/asort.c
    % added new code for ASort()
      Warning: new sorting algorithm is stable (does not change the
               order of equal items). It means is not strictly Cl*pper
               compatible and it can be seen some dummy ASort() tests
               in HBTEST results.
Parabéns ao Fernando Athayde!!!

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7929
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Função aSort() refeita, agora mais veloz.

Mensagem por Itamar M. Lins Jr. »

Será que melhorou ?

Código: Selecionar todos

function main()
   local i := hb_secondsCPU()
   ASort( AFill( Array( 50000 ), 0 ),,, {|x,y| x > y } )
   ? hb_secondsCPU() - i, "sec."
return nil

Before: 390.99 sec
After: 0.12 sec 
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Responder