GitXplorerGitXplorer
m

1brc-perl

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
7cfffa5a92e9eefdae071227b0a0be1cbca09b6c

Count the last line properly

committed a year ago
Unverified
b31e6bcbec32edafbaeec4be36ee92509b6916dd

Update readme

committed a year ago
Unverified
db9079bba277daa4e23545e10aae429c65b04c7d

Update readme

committed a year ago
Unverified
4782aa9ac065c3054ab36d6aa1ca0b94bfa5a96a

Update readme

committed a year ago
Unverified
916451a7cb762e5af4ee136b6b6c4ad18c0882b2

Update readme

committed a year ago
Unverified
e572586321a8a98784675152f8b35fc8ea42705d

Update readme

committed a year ago

README

The README file for this repository.
  • 1brc-perl-semipar.pl reads file and forks when number of lines is reached, uses Parallel::ForkManager

  • 1brc-pfm-mestia.pl splits file into chunks and forks code for each section - higher memory usage but can utilize more cpu cores, bottleneck is obviously the I/O. Has a problem when requesting more cores than available, buffer passed to proc_chunc() gets rundomly truncated.

  • 1brc-mce-mestia.pl MCE implementation

Source file

compile and run create-sample.c for the sample file. Code is available here: https://github.com/dannyvankooten/1brc

Some stats ( running on AMD EPYC 7702P 64-Core Processor and a SSD pool )

 64 cores; real: 0m23.951s, user: 23m4.662s,  sys: 0m13.939s ; time perl 1brc-mce-mestia.pl ./measurements.txt 64
 8 cores ; real: 1m59.429s, user: 15m36.224s, sys: 0m7.145s  ; time perl 1brc-mce-mestia.pl ./measurements.txt 8
 8 cores ; real: 2m0.195s,  user: 15m22.971s, sys: 0m27.302s ; time perl 1brc-pfm-mestia.pl ./measurements.txt 8

Probably the cleanest solution without modules like P::FM or MCE, https://github.com/adriaandens/1brc.pl/blob/main/forkie.pl

another MCE option: https://github.com/janlimpens/1brc-perl/blob/main/calculate_average_mce.pl

See also: