branch: externals/el-job commit 65a95306039ec8079e73a6bd77fabad51e1f6550 Author: Martin Edström <meedstro...@gmail.com> Commit: Martin Edström <meedstro...@gmail.com>
Assign to FSF --- .gitignore | 5 +++++ el-job-child.el | 2 +- el-job-test.el | 3 ++- el-job.el | 46 +++++++++++++++++++++++++++------------------- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..e9e55cfcde --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.elc + +# ELPA-generated files. +el-job-pkg.el +el-job-autoloads.el diff --git a/el-job-child.el b/el-job-child.el index fe1f9c2707..849ad7e32f 100644 --- a/el-job-child.el +++ b/el-job-child.el @@ -1,6 +1,6 @@ ;;; el-job-child.el --- Worker code for children -*- lexical-binding: t; -*- -;; Copyright (C) 2024-2025 Martin Edström +;; Copyright (C) 2024-2025 Free Software Foundation, Inc. ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/el-job-test.el b/el-job-test.el index 406d38056e..e46f009d90 100644 --- a/el-job-test.el +++ b/el-job-test.el @@ -1,6 +1,6 @@ ;;; el-job-test.el --- Test suite -*- lexical-binding: t; -*- -;; Copyright (C) 2024-2025 Martin Edström +;; Copyright (C) 2024-2025 Free Software Foundation, Inc. ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ (require 'map) (require 'cl-lib) (require 'el-job) +(require 'el-job-child) (ert-deftest el-job--split-optimally () ;; All benchmarks at zero diff --git a/el-job.el b/el-job.el index 4826e62b93..a92bad676f 100644 --- a/el-job.el +++ b/el-job.el @@ -1,17 +1,17 @@ ;;; el-job.el --- Contrived way to call a function using all CPU cores -*- lexical-binding: t; -*- -;; Copyright (C) 2024-2025 Martin Edström -;; +;; Copyright (C) 2024-2025 Free Software Foundation, Inc. + ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. -;; + ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; + ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see <http://www.gnu.org/licenses/>. @@ -47,6 +47,14 @@ ;;; Code: +;; Wish-list: +;; - Figure out how to use `dump-emacs-portable' after loading any number of +;; features so we can reuse that to start the subprocesses instantly. Could +;; even simplify to a sentinel-based workflow then, no polling. + +;; - Figure out how to allow more than one list of INPUTS. That'd let this +;; library be applicable to many more situations. + (require 'cl-lib) (require 'el-job-child) @@ -205,7 +213,7 @@ past to pass this item through the FUNCALL-PER-INPUT function specified by `el-job-launch'. Use these benchmarks to rebalance the lists so that each sub-list should -take around the same amount of wall-time to work through. +take a similar amount of wall-time to work through. This reduces the risk that one child takes markedly longer due to being saddled with a huge item in addition to the average workload." @@ -765,20 +773,20 @@ Safely return nil otherwise, whether or not ID is known." ;;; Ok, don't need to break convention anymore. -(define-obsolete-function-alias 'el-job:id 'el-job-id "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:callback 'el-job-callback "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:n-cores-to-use 'el-job-n-cores-to-use "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:ready 'el-job-ready "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:busy 'el-job-busy "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:stderr 'el-job-stderr "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:timestamps 'el-job-timestamps "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:poll-timer 'el-job-timer "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:finish-times 'el-job-finish-times "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:spawn-args 'el-job-spawn-args "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:past-elapsed 'el-job-past-elapsed "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:queued-inputs 'el-job-queued-inputs "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:input-sets 'el-job-input-sets "2.3.0 (2025-03-16)") -(define-obsolete-function-alias 'el-job:result-sets 'el-job-result-sets "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:id #'el-job-id "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:callback #'el-job-callback "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:n-cores-to-use #'el-job-n-cores-to-use "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:ready #'el-job-ready "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:busy #'el-job-busy "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:stderr #'el-job-stderr "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:timestamps #'el-job-timestamps "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:poll-timer #'el-job-timer "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:finish-times #'el-job-finish-times "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:spawn-args #'el-job-spawn-args "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:past-elapsed #'el-job-past-elapsed "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:queued-inputs #'el-job-queued-inputs "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:input-sets #'el-job-input-sets "2.3.0 (2025-03-16)") +(define-obsolete-function-alias 'el-job:result-sets #'el-job-result-sets "2.3.0 (2025-03-16)") (provide 'el-job)