avatarBill Myers

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

4709

Abstract

de> command with parallelism.</p><h2 id="9570">Benchmarks</h2><p id="dc98">Benchmarks conducted on four different repositories revealed that a hot mvnd execution, where the daemon is already running, can accelerate builds by up to 50% of builds that do not run tests or static analysis as this is the most common use-case among developers in our organization.</p><figure id="442c"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*xot8KoV94usih-4e"><figcaption></figcaption></figure><h2 id="77be">Local vs CI server</h2><p id="ac6e">Using Maven Daemon significantly sped up our local builds, making our engineers’ daily iterations faster and more efficient. However, this solution wasn’t suitable for our CI environment with TeamCity. Since we don’t reuse TeamCity, there was no benefit to starting a daemon process in this context.</p><p id="3916">In response to this limitation, we will be exploring the possibility of reusing agents and investigating potential improvements in a different initiative to better optimize our CI environment.</p><h2 id="c57d">Adoption</h2><p id="8fb7">To ensure every Java team at Picnic could benefit from the increased speed of local builds using Maven Daemon, we created a comprehensive knowledge article outlining the steps and best practices. By sharing this detailed knowledge article, we ensured that all developers in our organization could easily adopt and benefit from using Maven Daemon, leading to faster build times and improved productivity.</p><p id="436d">Currently, we don’t have visibility in the adoption rate here, but we are looking into using OpenTelemetry Maven extensions to get more insights into this to better track and advocate</p><h1 id="aceb">Maven Build Cache</h1><p id="6a2a">One of the best ways to speed up builds is to do less. And the best way to do less is to eliminate duplicate or unnecessary work. Why should we want to rebuild and retest all modules in our project if I change a single test, or a small if-statement in a module no other module depends on? We can use a build cache to only execute Maven goals for modules that changed and modules that depend on these changes.</p><h2 id="f90a">How does it work</h2><p id="5cdc">The Maven Build Cache extension enhances the efficiency of large Maven projects by implementing the following set of features:</p><ol><li><b>Incremental Builds</b>: Only the modified parts of the project graph are rebuilt.</li><li><b>Subtree Support</b>: Allows isolated builds of specific parts in multi-module projects.</li><li><b>Version Normalization</b>: Facilitates version-agnostic caching.</li><li><b>Project State Restoration</b>: Avoids repeating expensive tasks like code generation by restoring previous states from the cache.</li></ol><figure id="5b07"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*ehx_WSQV_zw9e68p"><figcaption>The diagram shows that changes in a module (Module 2) lead to it and its dependents (Module 3) being rebuilt, while unchanged modules (Module 1 and Module 4) are retrieved from the cache.</figcaption></figure><h2 id="28f6">Local Build Cache</h2><p id="2678">When working locally, the Maven Build Cache stores the build output artifacts in a designated local cache directory. Here’s a step-by-step breakdown of how it operates:</p><ol><li><b>Initial Build:

  • </b>During the first build, Maven compiles the entire project as usual.
  • For each module, the build cache extension computes a unique hash based on the module’s inputs (source files, Maven configuration, dependencies, etc.).
  • The build outputs (e.g., compiled classes, packaged artifacts) are stored in the local cache directory with the computed key.</li><li><b>Subsequent Builds:
  • </b>Before building a module, Maven checks the local cache directory to see if there is a cached result for the module’s hash.
  • If a match is found, the cached outputs are restored, and Maven goals executed when the cache was constructed are now skipped.
  • If no match is found, Maven rebuilds the module, and the new outputs are cached for future use.</li><li><b>Cache Management:
  • </b>The local cache can be configured to limit its size and manage the retention of cached artifacts.
  • Policies can be defined to periodically clean up old or infrequently used cache entries, ensuring the cache directory remains manageable.</li><li><b>Key Generation:
  • </b>The unique key for each module is generated by hashing the module’s inputs. This includes source code files, project model (POM file), plugin configurations and parameters, and dependency versions and configurations.
  • By including all relevant inputs in the key, the build cache ensures that any change in the inputs results i

Options

n a new key, prompting a rebuild.</li></ol><p id="4903">The build cache uses hashing to generate unique keys for storing and restoring build results. Correctness is maximized by including all relevant files and functional plugin parameters, while reuse is enhanced by filtering non-essential files and minimizing controlled plugin parameters. Configuration involves balancing correctness and performance through an XML file, <code>buildinfo.xml</code>.</p><h2 id="88d2">Usage in CI</h2><p id="6966">In our CI process, we also leverage the Maven Build Cache solution to accelerate our CI builds. However, for CI, we employ <a href="https://maven.apache.org/extensions/maven-build-cache-extension/remote-cache.html">a remote cache</a> stored in an artifactory instead of using a local directory. In our case, cached artifacts are stored in Nexus. This approach has markedly increased the speed of our Java builds. Consequently, our builds finish sooner and build queues are shorter.</p><p id="d0a3">However, in certain situations, users need to perform a full build of their changes. To accommodate this, we introduced a TeamCity parameter called “Use Maven build cache” with the following options:</p><ul><li><code>true</code>: the cache is used</li><li><code>false</code>: the cache is not used</li><li><code>default</code>: the repository-level setting is applied</li></ul><figure id="51f5"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*cjBQGpXtPyo_8MeafHw1TA.png"><figcaption></figcaption></figure><p id="76d0">It is good to note that we currently employ the cache only for builds that do not create production artifacts, as we wish to have these as ‘pure’ as possible. As such, we disable the cache for builds on default branches supporting continuous deployments, and in release builds.</p><h2 id="1253">Benchmarks</h2><p id="12d5">In the best-case scenario, the execution time of CI builds dropped by ~ 90% when execution of every module was skipped, this is how it was shown in the build logs:</p><div id="bdae"><pre>[INFO] Skipping plugin execution (cached): <span class="hljs-keyword">install</span>:<span class="hljs-keyword">install</span></pre></div><p id="72cd">Instead of 10 minutes 4 seconds, the build that was fully cached took only 1 minute 22 seconds. 😲</p><p id="fb1e">Of course, this is quite a rare case to run a build that has every module skipped. The average build time improvement across all Java repositories in Picnic is shown in the picture below. It is noticeable that build time dropped by 62% in general.</p><figure id="3fd7"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*m9KcQpIhbc66wTHDIvttPQ.jpeg"><figcaption></figcaption></figure><p id="97f1">For some repositories, the build time improvement was more noticeable than for others. Projects with many modules benefit more than projects with only a few modules. This can be seen in the chart below showing P75 build times. Highly modular projects see their build times drop from 10 to 5 minutes. Projects with a few modules only benefit little from this improvement.</p><figure id="8e53"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*Qp8AmIXK7M0xzbuc"><figcaption></figcaption></figure><h1 id="d1eb">Conclusion</h1><ol><li><b>Dramatic Build Time Reduction:

  • </b>Build times dropped from 12 minutes to 8 minutes in general. This significant improvement eliminates long waits, allowing developers to maintain focus and productivity.</li><li><b>Enhanced Developer Experience:
  • </b>Faster build times, especially for local builds, lead to fewer interruptions, enabling developers to stay in the zone and work more efficiently. This improvement has contributed to higher job satisfaction and overall happiness among our teams.</li><li><b>Increased Efficiency in CI Pipelines:
  • </b>Using the Maven Build Cache in our CI environment has sped up CI builds, reduced queue times, and made TeamCity agents available more quickly.</li></ol><p id="46a2">These improvements have significantly boosted developer morale and productivity. Reduced build times mean less context switching, quicker feedback, and a more enjoyable workflow.</p><p id="316d">Developers feel more empowered and efficient, resulting in higher-quality code and faster feature implementation.</p><p id="90d2">In summary, the integration of the Maven Build Cache extension and Maven Daemon has transformed our build process, making it faster and more efficient. We are excited to continue leveraging these tools to maintain and further improve our build processes, ensuring our developers have the best possible experience.</p><p id="0bd6">In collaboration with <b>Pieter Dirk Soels</b></p></article></body>

HIDDEN Consequences

How Texas has Legalized Extortion!

I thought the cruelty of torture was outlawed until I read the Texas abortion bill. Then there is a Guilty until Proven Innocent provision.

Photo by Henry & Co. on Unsplash

Synopsis

The abortion bill may have opened a huge Pandora’s box by legalizing extortion for an individual abortion, plus many other things. There is no reason the worst provisions in that bill can’t be written into every other law. First, a definition:

extortion (noun) the practice of obtaining something, especially money, through force or threats.

Definitions from Oxford Languages

Then, to meet the “the equal protection of the laws” portion of the 14th Amendment, they need to expand the extortion rights to all people for all actions.

Different types of extortion

Typically, the extortionist is after money, but extortion can also be used to force actions. The foundation of extortion is making threats.

Here, the extortionist may receive up to $10,000. The defendant will always be forced to pay, at least the legal fees, even if they win.

I can foresee a whole new, sleazy syndicate forming, encouraged by the State of Texas, just to collect the $10,000 rewards.

Torture

Torture can take many forms. Most common is physical violence causing great pain. Mental torture can cause people to break down and do things they normally would not do.

Mental torture can lodge itself in the person’s memory and inflict pain every day for the rest of their life.

The law requires these actions if a woman must have an abortion to save her life:

SECTION 8.(a)(4)(B) the physician who is to perform or induce the abortion … displays the sonogram images
 (D) the physician who is to perform or induce the
abortion … makes audible the heart auscultation for the pregnant woman to hear

Abortion or die is distressing enough, but having to listen to your baby's heartbeat might traumatize the poor woman for the rest of her life, a form of mental torture.

What a sadistic section of the bill.

Pregnancy - a new definition

Most people understand that a pregnancy starts when the sperm and egg get together, but not the State of Texas.

SECTION 3, SUBCHAPTER H, (5) “Pregnancy” means the human female reproductive condition that: (C) is calculated from the first day of the woman’s last menstrual period.

They claim in part (A) that it begins with fertilization, but that can’t happen under (C), which may be days earlier, so the (C) timeframe overrides (A).

By definition, a pregnancy starts with the beginning of the cycle.

Guilty until Proven Innocent provision & the Burden of Distance

The law provides that a private citizen can sue anybody who assists in or facilitates an abortion. Anybody is a large population and every accusation has to be defended.

Sec. 171.208., (f-1) The defendant has the burden of proving an affirmative defense under Subsection (f)(1) or (2) by a preponderance of the evidence.

The defendant has the burden of proving that they are innocent. In addition, the suit can be filed anywhere in Texas and the defendant can be in another distant location.

Sec. 171.210., (a), (4) the county of residence for the claimant if the claimant is a natural person residing in this state. 
(b) … any one of the venues described by Subsection (a), the action may not be transferred to a different venue without the written consent of all parties.

So, someone in Beaumont, Texas, could file suit in the Beaumont court against someone in El Paso, 827 miles away, and the defendant would have to fight the case in Beaumont. What a huge stress and cost.

Some articles claim that anyone in the entire U.S. can file suit, but I could not find anything in the bill supporting that claim.

Encourages Self-Abortions

Since pregnancy starts with the cycle, if a new cycle begins, obviously an abortion was performed in-between. If the woman didn’t go to a doctor or back-street abortionist, they must have performed it on themselves.

Everyone should perform surgery on themselves!

Since the woman performed the abortion, that means that anybody can sue the woman. So,

Every woman who has a menstrual period can be sued by anyone in the state of Texas!

This just puts the entire law into the proper perspective.

Overflow

The 6-week time frame is ridiculous, but that is just one of the many horrors of the Texas Anti-Abortion bill and keeps it from violating the 13th Amendment. The things I listed are far worse, starting with using the courts for political goals via civil suits.

Note Jan 21, 2021: Since, by definition, the pregnancy starts at the beginning of the period, the woman may have only 1 or 2 weeks to find a doctor and get an abortion from the time she knows she is pregnant.

Such lawsuits are pure harassment of the poor and middle class. Of course, the rich will go to another state or country and buy off the politicians, like they always do.

However, lawsuits have always been there for people who have sustained an injury. This bill expands that capability to anyone who has hurt feelings, even if they were not injured or directly impacted.

Failure to expand such lawsuits to everything would be discrimination — we certainly don’t want that!

To be consistent, Texas needs to pass another law allowing anybody to sue anybody else over hurt feelings.

Severance — Court Decisions

The bill contains clauses that make court challenges even more difficult.

SECTION 10. Every provision in this Act and every application of the provision in this Act are severable from each other. If any provision or application of any provision in this Act to any person, group of persons, or circumstance is held by a court to be invalid, the invalidity does not affect the other provisions or applications of this Act.

Every single section of the bill must be challenged and thrown out by the court. If a section is not explicitly included in a ruling, it remains in effect.

Discriminatory

Notice that men have no responsibility.

That could have been changed by adding the requirement that DNA samples be taken at birth. Then, any man who gets a woman pregnant, aborted or full-term, would pay 20% of their income for 18 years in child support.

Of course, nothing like that would occur to the men and the conflict-of-interest lawyers in the legislature.

Conclusion

These are just a few highlights from this remarkably cruel bill, reminiscent of the Middle Ages. It is one of the most invasive and controlling bills I’ve seen in a long time.

Those who can’t learn from history are doomed to repeat it. This bill is a huge power grab that may be expanded to other bills. Abortion is just a secondary issue to incite the masses. The bill:

  • Redefined “Pregnancy” and its starting point. If the government can do that, then they can redefine anything to their purposes
  • Institutes a new version of the vigilantes
  • Reverses the “Innocent until Proven Guilty” doctrine
  • Only the 6-week cutoff point, nearly impossible to attain, prevents it from violating the 13th amendment on slavery
  • Reinstates torture
  • Legalizes extortion

Some of the points in this article may sound like nonsense, but the entire bill is nonsense. If I came to this conclusion about its main points, some lawyers will, too, and exploit it.

Until then, the best thing that could happen is that the Supreme Court tosses this bill out in its entirety.

Disclaimer. This article reflects the opinion of the author based on reading the Texas Abortion bill and is not intended as legal advice. If you need advice, you should consult an attorney.

References & Related Articles

  • Father is immediately identifiable and pays support 18 years no matter what
  • Bounty hunters. The new law has a huge reach for the $10,000 bounty

I see two-dozen injury lawyer ads on TV per day. Imagine the flood of ads with legalized extortion.

SB8 Bill Text from LegiScan

https://legiscan.com/TX/text/SB8/id/2352120

Other Articles in the Same Category

https://readmedium.com/the-abortion-issue-is-complicated-by-technical-mistakes-and-logic-errors-by-the-supreme-court-1e3785825bcb?sk=c13ae8df97d9335645289fad9ea03e8a

Politics
Abortion
Equality
Law
Due Process
Recommended from ReadMedium
avatarAnthony (Tony/Pcunix) Lawrence 👀
I Have Decided I Cannot Vote For Camila

I just cannot

2 min read