Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haskell memory tests #1286

Closed
wants to merge 10 commits into from
Closed

Conversation

Qu4tro
Copy link
Contributor

@Qu4tro Qu4tro commented Apr 28, 2019

Hey there,

This PR creates a new test-suit. This test suit is meant to measure memory-usage in the likes of the current memory-tests.sh. It uses the weigh package to provide the necessary tooling.

One thing of note is that the results don't match to bash tests. I'm not sure why that it is, yet.

Additionally and TODO: Check status code of requests.

@Qu4tro
Copy link
Contributor Author

Qu4tro commented Apr 28, 2019

Tests are currently failing, due to different measurements, which I guess stem from hardware differences. This could be easily changed to accommodate Circle.

On both circle and locally the results seems to be consistent, though. I've also tried circleci local execute --job build-test-9.4 and the tests pass.

Keeping it that way for until further discussion.

Edit: To run new test-suit only: stack test postgrest:memory .

@steve-chavez
Copy link
Member

@Qu4tro Cool usage of weigh. Is the intention to replace the bash test suite?

Also, I've ran the new test suite several times and somehow it takes like 5-6 minutes to complete. Does the same happen to you?

@Qu4tro
Copy link
Contributor Author

Qu4tro commented Apr 29, 2019

Yes, the intention would be to get rid of the bash tests. I think having them in Haskell, would incentivize the creation of more memory tests.

Do you mean both test-suits or just the memory one?
I got 4 minutes for both (and some compiling) and just under a minute with the memory suit alone.
Same thing in both docker/local postgres.

@steve-chavez
Copy link
Member

Only running stack test postgrest:memory takes 5-6 minutes for me. Not sure why.

test/Memory.hs Outdated Show resolved Hide resolved
@Qu4tro
Copy link
Contributor Author

Qu4tro commented Apr 30, 2019

Ah thanks. Will fix.

I should also be able to get the status codes of the responses, so that these mistakes are easily found .

@Qu4tro
Copy link
Contributor Author

Qu4tro commented May 1, 2019

@steve-chavez if it helps, the output of inxi on my laptop:

❯ inxi -b
System:
  Host: thinkpad4 Kernel: 5.0.10-arch1-1-ARCH x86_64 bits: 64 
  Desktop: i3 4.16.1-107-g41264e54 Distro: Arch Linux 
Machine:
  Type: Laptop System: LENOVO product: 20LS001APG v: ThinkPad L480 
  serial: <root required> 
  Mobo: LENOVO model: 20LS001APG v: SDK0J40697 WIN serial: <root required> 
  UEFI: LENOVO v: R0QET41W (1.18 ) date: 04/03/2018 
Battery:
  ID-1: BAT0 charge: 39.7 Wh condition: 39.7/45.0 Wh (88%) 
CPU:
  Quad Core: Intel Core i5-8250U type: MT MCP speed: 800 MHz min/max: 400/3400 MHz 
Graphics:
  Device-1: Intel UHD Graphics 620 driver: i915 v: kernel 
  Display: tty server: X.Org 1.20.4 driver: i915 resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa DRI Intel UHD Graphics 620 (Kabylake GT2) 
  v: 4.5 Mesa 19.0.3 
Network:
  Device-1: Intel Ethernet I219-V driver: e1000e 
  Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi 
Drives:
  Local Storage: total: 238.47 GiB used: 114.55 GiB (48.0%) 
Info:
  Processes: 215 Uptime: 10m Memory: 15.43 GiB used: 2.98 GiB (19.3%) Shell: zsh 
  inxi: 3.0.33 

@Qu4tro Qu4tro force-pushed the feature/haskell-memory-tests branch from 222f7a8 to a3c1ecc Compare May 24, 2019 00:32
@steve-chavez
Copy link
Member

We're now getting a lot of out of memory errors when compiling with stack build --profile.

@Qu4tro I wanted to ask you, using weigh requires compiling with profiling enabled?

From this PR I'm left with the impression that it's not required. I'm wondering how weigh works in that case. Perhaps you can elaborate on this.

@steve-chavez
Copy link
Member

Hmm. This kind of explains that weigh doesn't need ghc profiling enabled fpco/weigh#14.

@steve-chavez steve-chavez mentioned this pull request Jul 25, 2019
@steve-chavez
Copy link
Member

Still like the idea of having the memory tests in Haskell. The code here is really good so I'll leave the PR open for someone to pick it up.

@wolfgangwalther wolfgangwalther changed the base branch from master to main December 31, 2020 14:12
@steve-chavez
Copy link
Member

An all-haskell test suite doesn't look close at the moment: we even have IO tests in python now.

We might get more attempts at this after #1804 is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants