por
pobrecito hablador
el Martes, 13 Noviembre de 2007, 13:16h
(#981349)
Soy al que has quoteado.
Mania de que? No lo digo yo, lo dice google:
Use Native Methods
When processing strings, don't hesitate to use specialty methods like String.indexOf(), String.lastIndexOf(), and their cousins. These are typically implemented in C/C++ code that easily runs 10-100x faster than doing the same thing in a Java loop.
The flip side of that advice is that calling punching through to a native method is more expensive than calling an interpreted method. Don't use native methods for trivial computation, if you can avoid it.
Si conoces el tamaño de los elementos, para un string en C++, el caracter x de la cadena es desplazar x*tamaño un puntero. Si en java utilizas un bucle por cojones será mas lento.
Re:WTF?
(Puntos:0)Mania de que? No lo digo yo, lo dice google:
Use Native Methods
When processing strings, don't hesitate to use specialty methods like String.indexOf(), String.lastIndexOf(), and their cousins. These are typically implemented in C/C++ code that easily runs 10-100x faster than doing the same thing in a Java loop.
The flip side of that advice is that calling punching through to a native method is more expensive than calling an interpreted method. Don't use native methods for trivial computation, if you can avoid it.
http://code.google.com/android/toolbox/performanc
Re:WTF?
(Puntos:2)