본문 바로가기

Programming/HTML

jQuery and Prototype Benchmarks 누가 이겼을까?

jQuery and Prototype Benchmarks

Piotr Solnica did a couple of posts on jQuery and Prototype benchmarks back in the day, and John-David Dalton just found them.
Piotr Solnica 씨가 예전에 jQuery와 Prototype에 관한 두 개의 포스트를 썼는데, John-David Dalton 씨가 그것들을 찾았습니다.

In part one, he runs tests such as:
첫번째는 다음과 같이 테스트를 진행했습니다:


JAVASCRIPT:

  1. $('td.first').addClass('marked'); // jQuery
  2.  
  3. $$('td.first').each(function(cell){
  4.   cell.addClassName('marked');
  5. });
  6.  
  7. // or
  8.  
  9. $$('td.first').invoke('addClassName', 'marked');
  10.  

and concludes:
결론입니다:

Executed tests show that Prototype seems to be faster then jQuery, with the exception of the new insertion method, which performance should be improved. Although I like jQuery syntax more then Prototype, the performance is way more important then saving few lines of code. Of course tests that I made don’t show how these libraries act in a real application, which is my task for the next part(s) of this article. Despite the results I must admit that I’m very excited about jQuery, my general impression is that this library is more mature then Prototype.
테스트 결과, 삽입 메소드는 개선되어야 할 필요가 있지만 Prototype이 jQuery보다 빠른 것 같다. Prototype 보다 jQuery 같은 문법을 좋아하기는 하지만, 성능은 코드 몇 줄 절약하는 것보다 더 중요하다. 물론 내가 만든 테스트가 이 라이브러리들이 실제 응용프로그램에서 어떻게 동작하는지를 보여줄 수는 없다. 그것은 이 글 다음에 쓸 작업이다. 결과에도 불구하고 나는 jQuery가 매우 흥미롭다는 것은 인정한다. 내 일반적인 느낌은 이 라이브러리가 Prototype보다 조금 더 성숙한 것 같다는 것이다.

In part two, Piotr uses a custom JavaScript-based testing environment instead of running tests using Firebug profiler. This allows the test suite to run in many browsers, and this time concludes:
두번째는, Piotr씨는 Firebug 프로파일러를 이용하는 실행 테스트 대신 스스로 만든 JavaScript 기반 테스트 환경을 사용했습니다. 덕분에 테스트 수트가 여러 브라우저에서 동작하게 되었습니다:

Prototype was at least 2 times faster then jQuery in 15 cases, and jQuery was faster then Prototype in 8 cases. What library should I choose? In my case I will stick with Prototype, because it offers the same functionality as jQuery does + more and it’s faster. jQuery is probably better for projects where there’s a need for some fancy UI effects and that’s it, but it’s just an assumption, correct me if I’m wrong…
Prototype은 15가지 항목에서 jQuery 보다 최소 2배 정도 빨랐고, jQuery는 8가지 항목에서 Prototype 보다 빨랐다. 어떤 라이브러리를 선택해야할까? 내 경우라면, Prototype인데, jQuery와 같은 기능을 제공해주면서도 빠르기 때문이다. jQuery는 아마도 이쁜 UI 효과가 필요한 프로젝트에 어울릴 것 같지만 그냥 내 생각일 뿐이다. 틀렸으면 바로 잡아주기 바란다...
결론은 Prototype Winner~~~

출처 : http://ajaxian.com/archives/jquery-and-prototype-benchmarks