Code Monkey home page Code Monkey logo

Comments (9)

ganghe74 avatar ganghe74 commented on August 10, 2024

제일 무난해보이는걸로는 GNU time 유틸리티가 있는데 >\time --verbose ./run
ms 단위 시간측정은 지원하지 않는 것 같다.,

from .dotfiles.

ganghe74 avatar ganghe74 commented on August 10, 2024

일단 ms 단위 시간측정은 기존 스크립트를 이용하고, 메모리 측정은 GNU time을 이용하기로 결정하였다.

from .dotfiles.

ganghe74 avatar ganghe74 commented on August 10, 2024

이슈가 하나 있었는데, 컴파일 옵션으로 인해서 로컬과 저지 사이트의 메모리 사용량과 차이가 있다는것이다.
링크 방식과, 최적화옵션 등이 영향을 준것같아서 고쳐주었다.
고친것도 400KB 정도 차이가 있긴 한데, 측정방식이 다르다던가, 실행환경이 다르다던가, 저지사이트 내부적으로 코드에 무언가 처리를 한다던가.. 다양한 의심이 들지만 이정도 측정으로 만족해야겠다.
애초에 메모리 측정 옵션은 중요한게 아니니깐,, PS 정도 코드에서는 어느정도 공간복잡도 계산이 가능하다.

2b0f06d

from .dotfiles.

ganghe74 avatar ganghe74 commented on August 10, 2024

일단 -r -o 옵션이 없는 일반적인 경우에만 메모리측정을 추가했다.
93d4d9d

from .dotfiles.

ganghe74 avatar ganghe74 commented on August 10, 2024

메모리 사용량이 제대로 측정되지 않는듯 하다.
https://www.acmicpc.net/source/17590467 소스코드에 대해서
스크립트상으로 Memory usage: 1460KB 라고 떳지만, [100,000][3] 크기의 배열 3개를 선언했으므로
최소 100,000 * 3 * 3 * 4 bytes = 3,600,000 bytes = 3600 KB이어야한다.

from .dotfiles.

ganghe74 avatar ganghe74 commented on August 10, 2024
#include <bits/stdc++.h>
using namespace std;

int a[10'000'000];

int main() {
    for (int i=0;i<1'000'000;++i) a[i] = i;
}

위 코드는 5420 KB 라고 뜨고

#include <bits/stdc++.h>
using namespace std;

int a[10'000'000];

int main() {
    for (int i=0;i<10'000'000;++i) a[i] = i;
}

이 코드는 40568 KB 이라 뜬다.....
단순히 배열을 잡는다고 메모리 사용량으로 뜨는건 아닌거같고.. 일단 보류

from .dotfiles.

ganghe74 avatar ganghe74 commented on August 10, 2024

몇달동안 써본결과 GNU time의 정보는 어느정도 참고할 만하다.

from .dotfiles.

ganghe74 avatar ganghe74 commented on August 10, 2024

5014562
파이썬 스크립트로 업데이트함.
새로운 파이썬 스크립트에서 시간측정, 메모리 측정이 필요하다

from .dotfiles.

ganghe74 avatar ganghe74 commented on August 10, 2024

#7

from .dotfiles.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.